CI #995
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
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: 0 1 * * 1-5 | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Lint code | |
run: bin/rake lint | |
- name: Generate docs | |
run: bin/rake docs | |
test-matrix: | |
name: Generate test matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.test-matrix.outputs.matrix }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- id: test-matrix | |
name: Generate test matrix | |
run: bin/test-matrix | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
test: | |
name: Test (${{ matrix.title }}) | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ github.event_name != 'schedule' && endsWith(matrix.cerbos, '-prerelease') }} | |
env: | |
CERBOS_VERSION: ${{ matrix.cerbos }} | |
TEST_MATRIX_DEPENDENCY_NAME: ${{ matrix.dependency_name }} | |
TEST_MATRIX_DEPENDENCY_VERSION: ${{ matrix.dependency_version }} | |
needs: | |
- test-matrix | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.test-matrix.outputs.matrix) }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
- name: Update Gemfile.lock | |
if: ${{ matrix.dependency_name }} | |
run: bin/bundle lock --update ${{ matrix.dependency_name }} | |
- name: Install gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: List installed gems | |
run: bin/bundle list | |
- name: Start test servers | |
run: bin/rake test:servers:start | |
- name: Run tests | |
run: bin/rake test | |
test-results: | |
name: Check test results | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- test | |
steps: | |
- name: Check test results | |
run: test "${{ needs.test.result }}" = "success" |