Merge pull request #292 from manicmaniac/output-lcov #708
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: test | |
on: [push] | |
jobs: | |
test: | |
runs-on: macOS-14 | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: | |
- '2.7' | |
- '3.0' | |
- '3.1' | |
- '3.2' | |
- '3.3' | |
- '3.4' | |
env: | |
DEVELOPER_DIR: '/Applications/Xcode_15.4.app/Contents/Developer' | |
steps: | |
- uses: actions/checkout@v4 | |
- 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-darwin-amd64 | |
chmod +x cc-test-reporter | |
- run: ./cc-test-reporter before-build | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
- run: bundle exec rake | |
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-24.04 | |
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 }} |