Update actions/checkout action to v4 #200
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: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: | |
- '2.7' | |
- '3.0' | |
- '3.1' | |
- '3.2' | |
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 }} | |
- run: bundle exec rake test | |
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 simplecov --output 'codeclimate-${{ matrix.ruby-version }}.json' | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: coverages | |
path: codeclimate-${{ matrix.ruby-version }}.json | |
upload-coverage: | |
runs-on: ubuntu-20.04 | |
needs: test | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: coverages | |
- 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 --input - | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler-cache: true | |
- run: bundle exec rake rubocop | |
- run: bundle exec rake steep |