.github/workflows/test.yml
name: teston: pushjobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby-version: - '2.7' - '3.0' - '3.1' - '3.2' - '3.3' - '3.4' steps: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - name: Install cc-test-reporter run: | curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 chmod +x cc-test-reporter - run: ./cc-test-reporter before-build env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - name: Run tests run: bundle exec rake spec env: CC_TEST_REPORTER_ID: dummy # https://github.com/codeclimate/test-reporter/issues/495 - name: Format coverage run: ./cc-test-reporter format-coverage --input-type lcov --output 'codeclimate-${{ matrix.ruby-version }}.json' - uses: actions/upload-artifact@v4 with: name: coverages-ruby-${{ matrix.ruby-version }} path: codeclimate-${{ matrix.ruby-version }}.json upload-coverage: runs-on: ubuntu-latest if: always() needs: test steps: - name: Check test matrix status if: ${{ needs.test.result != 'success' }} run: exit 1 - uses: actions/download-artifact@v4 with: pattern: coverages-* merge-multiple: true - name: Install cc-test-reporter run: | curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 chmod +x cc-test-reporter - name: Upload coverage run: ./cc-test-reporter sum-coverage --output - codeclimate-*.json | ./cc-test-reporter upload-coverage --debug --input - env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}