.github/workflows/ci.yaml
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
name: "ruby ${{ matrix.ruby }}"
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Run Test with rspec
run: bundle exec rspec spec
rubocop:
name: Rubocop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Build and test
run: |
bundle exec rubocop
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- 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 }}