.github/workflows/rspec.yml
name: RSpec
on: [push]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler: 2.2.15
bundler-cache: true
- name: Install Code Climate reporter
run: |
sudo curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
sudo chmod +x ./cc-test-reporter
- name: Generate Coverage
env:
COV: true
CC_TEST_REPORTER_ID: 3a86801713dff2117de9a09cec46a179bbc693b353f299d83c8023ad96b36a21
run: |
export GIT_BRANCH=${GITHUB_REF#refs/heads/}
export GIT_COMMIT_SHA=${GITHUB_SHA}
echo $GIT_BRANCH
echo $GIT_COMMIT_SHA
./cc-test-reporter before-build
bin/rspec --require spec_helper --tag ~perf
./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
ruby: [2.5, 2.6, 2.7, 3.0]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: 2.2.15
bundler-cache: true
- run: bin/appraisal install --jobs=$(nproc) --retry=$(nproc)
- run: bin/appraisal rspec --require spec_helper --tag ~perf