Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change CI set-up to * Run on PRs from forked repos * Allow Dependabot-opened PRs to pass CI * Use tags to automatically set the gem version number, and build and push the gem to Ruby Gems. Details: Our branch protection rules require a number of CI checks to pass before a PR can be merged. This is a problem for PRs from forked repos and from Dependabot. The trigger for the CI workflow is any push to the repo, meaning that PRs from forks cannot trigger a test run. The CI workflow will now trigger on PR activity, enabling it on all PRs, regardless of origin. A repo maintainer must approve the workflow run for PRs from external forks in order to prevent abuse. This is already configured. Some of the CI checks depend on the upload of a code coverage report to Code Climate in the CI workflow's test job. This requires the use of a secret, but PRs raised from forks or by Dependabot do not have access to secrets. To address this, the coverage report will now be saved as an artefact. A separate workflow that runs on completion of the CI workflow, and that has access to the secrets, will retrieve the artefact and upload it to Code Climate. The push trigger will be restricted to pushes to master and pushes of specifically formatted version number tags (of the form vX.Y.Z). The trigger on pushed to master will help ensure master remains sane and keep the CI status up to date as PRs are merged. The trigger on pushing a tag will automatically build the gem and push it to Ruby Gems, assuming the tests passed. The gemspec will automatically set the version number based on the tag. This is done in a new job in the CI workflow. It requires access to a secret but, as the workflow will have been triggered by a push, it will have access to the secrets in this case.
- Loading branch information