.github/workflows/ci.yml in puffy-0.1.0 vs .github/workflows/ci.yml in puffy-0.2.0
- old
+ new
@@ -9,28 +9,46 @@
branches:
- main
- master
jobs:
+ rubocop:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: 3.0
+ bundler-cache: true
+ - name: Run static code analysis
+ run: bundle exec rubocop
unit:
runs-on: ubuntu-latest
+ needs: rubocop
strategy:
matrix:
ruby:
- "2.6"
- "2.7"
- "3.0"
+ - "3.1"
name: Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- - name: Install dependencies
- run: |
- gem install bundler
- bundle install --jobs 4 --retry 3
+ bundler-cache: true
- name: Generate the parser
run: bundle exec rake gen_parser
- - name: Run tests
+ - name: Run tests without uploading code coverage
+ if: ${{ matrix.ruby != '3.0' }}
run: bundle exec rake
+ - name: Run tests and upload coverage to Code Climate
+ if: ${{ matrix.ruby == '3.0' }}
+ uses: paambaati/codeclimate-action@v3.0.0
+ env:
+ CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
+ with:
+ coverageCommand: bundle exec rake