Fix Rubocop workflow #72
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout using GitHub's checkout action | |
- uses: actions/checkout@v2 | |
# Setup Ruby - this needs to match the version in the Gemfile | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@a699edbce608a2c128dedad88e3b6a0e28687b3c | |
with: | |
ruby-version: 2.6.6 | |
bundler-cache: true | |
# Setup code climate | |
- name: Setup Code Climate test-reporter | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | |
chmod +x ./cc-test-reporter | |
./cc-test-reporter before-build | |
# Run the tests | |
- name: Run Ruby tests | |
env: | |
CAPTURE_CODE_COVERAGE: true | |
run: | | |
bundle exec rake test | |
./cc-test-reporter format-coverage -t simplecov -o codeclimate.backend.json coverage/backend/.resultset.json | |
# Publish the coverage to CodeClimate | |
- name: Publish code coverage | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
env: | |
GIT_BRANCH: ${GITHUB_REF/refs\/heads\//} | |
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | |
run: | | |
./cc-test-reporter upload-coverage -i codeclimate.*.json |