.github/workflows/ci.yml
name: CI
on: [push]
jobs:
rspec:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.0', '3.1', '3.2']
name: "ruby ${{ matrix.ruby }}"
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Bundle install
run: |
gem install bundler
bundle install
- name: Run RSpec
run: |
bundle exec rspec
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Bundle install
run: |
gem install bundler
bundle install
- name: Run rubocop
run: |
bundle exec rubocop
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- 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
- name: Build and test with RSpec
run: |
gem install bundler
bundle install
bundle exec rspec
- name: Publish code coverage
run: |
./cc-test-reporter after-build -r ${{ secrets.CC_TEST_REPORTER_ID }}