Code Coverage #364
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: Code Coverage | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: 0 12 * * 5 | |
jobs: | |
coverage: | |
name: "Rails ${{ matrix.rails-version }} / Ruby ${{ matrix.ruby-version }}" | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile" | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: | |
- "2.7" | |
- "3.0" | |
- "3.1" | |
- "3.2" | |
- "3.3" | |
- "head" | |
rails-version: | |
- "6.1" | |
- "7.0" | |
- "7.1" | |
- "7.2" | |
include: | |
- ruby-version: "2.5" | |
rails-version: "6.1" | |
- ruby-version: "2.6" | |
rails-version: "6.1" | |
- ruby-version: "3.2" | |
rails-version: "edge" | |
- ruby-version: "3.3" | |
rails-version: "edge" | |
- ruby-version: "head" | |
rails-version: "edge" | |
exclude: | |
- ruby-version: "2.7" | |
rails-version: "7.2" | |
- ruby-version: "3.0" | |
rails-version: "7.2" | |
# mutex_m dropped from ruby >= 3.4, rails >= 7.2 | |
- ruby-version: "head" | |
rails-version: "6.1" | |
- ruby-version: "head" | |
rails-version: "7.0" | |
- ruby-version: "head" | |
rails-version: "7.1" | |
timeout-minutes: 3 | |
steps: | |
- uses: actions/checkout@v4 | |
# https://bundler.io/blog/2018/01/17/making-gem-development-a-little-better.html | |
- run: rm Gemfile.lock | |
- run: rm gemfiles/*.gemfile.lock | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
rubygems: 3.3.27 # last version to support Ruby 2.5 | |
bundler: latest | |
bundler-cache: true | |
- run: "bundle exec appraisal rails-${{ matrix.rails-version }} rake coverage:run" | |
- run: sudo apt install tree | |
- run: tree -a coverage | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "coverage-ruby-${{ matrix.ruby-version }}-rails-${{ matrix.rails-version }}" | |
path: coverage/ruby-* | |
include-hidden-files: true | |
retention-days: 1 | |
report: | |
name: "CodeCov (Rails ${{ matrix.rails-version }} / Ruby ${{ matrix.ruby-version }})" | |
needs: [coverage] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: | |
- "2.7" | |
- "3.0" | |
- "3.1" | |
- "3.2" | |
- "3.3" | |
- "head" | |
rails-version: | |
- "6.1" | |
- "7.0" | |
- "7.1" | |
- "7.2" | |
include: | |
- ruby-version: "2.5" | |
rails-version: "6.1" | |
- ruby-version: "2.6" | |
rails-version: "6.1" | |
- ruby-version: "3.2" | |
rails-version: "edge" | |
- ruby-version: "3.3" | |
rails-version: "edge" | |
- ruby-version: "head" | |
rails-version: "edge" | |
exclude: | |
- ruby-version: "2.7" | |
rails-version: "7.2" | |
- ruby-version: "3.0" | |
rails-version: "7.2" | |
# mutex_m dropped from ruby >= 3.4, rails >= 7.2 | |
- ruby-version: "head" | |
rails-version: "6.1" | |
- ruby-version: "head" | |
rails-version: "7.0" | |
- ruby-version: "head" | |
rails-version: "7.1" | |
timeout-minutes: 3 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: "coverage-ruby-${{ matrix.ruby-version }}*-rails-${{ matrix.rails-version }}*" | |
path: coverage | |
- run: sudo apt install tree | |
- run: tree -a coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
directory: coverage | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: "ruby-${{ matrix.ruby-version }}-rails-${{ matrix.rails-version }}" | |
fail_ci_if_error: true |