Lock file maintenance dependencies #617
Workflow file for this run
This file contains hidden or 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 | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source code | |
| uses: actions/checkout@v4 | |
| - name: Install Ruby and gems | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Run RuboCop | |
| run: bin/rake rubocop | |
| version-matrix: | |
| name: Generate version matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.version-matrix.outputs.matrix }} | |
| steps: | |
| - name: Check out source code | |
| uses: actions/checkout@v4 | |
| - name: Install Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler: none | |
| - name: Generate version matrix | |
| id: version-matrix | |
| run: bin/version-matrix | |
| test: | |
| needs: version-matrix | |
| strategy: | |
| matrix: ${{ fromJSON(needs.version-matrix.outputs.matrix) }} | |
| max-parallel: 8 | |
| name: Ruby ${{ matrix.ruby }} | PG ${{ matrix.pg }} | Active Record ${{ matrix.activerecord }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle | |
| ACTIVERECORD_VERSION: ${{ matrix.activerecord }} | |
| PG_VERSION: ${{ matrix.pg }} | |
| steps: | |
| - name: Check out source code | |
| uses: actions/checkout@v4 | |
| - name: Install Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| - name: Update Gemfile.lock | |
| run: bin/bundle lock --update activerecord pg railties | |
| - name: Install gems | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Run unit tests | |
| run: bin/rake test:unit | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| role-session-name: pg-aws_rds_iam-ci-${{ github.run_id }}-${{ github.run_attempt }}-${{ strategy.job-index }} | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| - name: Run acceptance tests | |
| run: bin/rake test:acceptance | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| SECURITY_GROUP_ID: ${{ secrets.SECURITY_GROUP_ID }} | |
| - name: Upload test coverage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-ruby-${{ matrix.ruby }}-pg-${{ matrix.pg }}-activerecord-${{ matrix.activerecord }} | |
| path: coverage/.resultset.json | |
| include-hidden-files: true | |
| test-results: | |
| name: Check test results | |
| if: always() | |
| needs: | |
| - version-matrix | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check test results | |
| run: test "${{ needs.test.result }}" = "success" | |
| - name: Check out source code | |
| uses: actions/checkout@v4 | |
| - name: Install Ruby and gems | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Download test coverage | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: coverage-* | |
| - name: Collate test coverage | |
| run: bin/rake coverage:collate | |
| - name: Upload test coverage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage | |
| - name: Report test coverage | |
| uses: k1LoW/octocov-action@v1.5.0 |