.github/workflows/main.yml in mnogootex-1.1.0 vs .github/workflows/main.yml in mnogootex-2.0.0

- old
+ new

@@ -3,39 +3,42 @@ on: push: pull_request: jobs: - main: - name: >- - ${{ matrix.os }} ${{ matrix.ruby }} - runs-on: ${{ matrix.os }}-latest + + test: + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ ubuntu, macos ] + os: [ 'ubuntu-latest', 'macos-latest' ] ruby: [ '2.6', '2.7', '3.0' ] + include: + - os: ubuntu-latest + ruby: '2.7' + coverage: true steps: - name: Checkout repo uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + - name: Setup Ruby + uses: ./.github/actions/setup-ruby with: ruby-version: ${{ matrix.ruby }} + cache-key: gems-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'mnogootex.gemspec') }} + cache-restore-keys: gems-${{ matrix.os }}-${{ matrix.ruby }}- - - name: Cache Ruby gems - uses: actions/cache@v2 - with: - path: vendor/bundle - key: gems-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'mnogootex.gemspec') }} - restore-keys: gems-${{ matrix.os }}-${{ matrix.ruby }}- - - - name: Install Ruby gems - run: | - bundle config path vendor/bundle - bundle install --jobs 3 --retry 3 - - name: Run tests run: bundle exec rake spec:rspec + + - name: Test and publish coverage to Code Climate + uses: paambaati/codeclimate-action@v3.0.0 + if: ${{ matrix.coverage && github.ref == 'refs/heads/main' }} + env: + CC_TEST_REPORTER_ID: 890ed5ee01002c7149920883256f8e4790000127faa9ddf14d86dd3ceb3b8179 + COVERAGE: true + with: + coverageCommand: bundle exec rspec + coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov