Skip to content

Commit

Permalink
ci: Upload coverage only on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
baygeldin committed Mar 11, 2022
1 parent e8dbdb5 commit 11194a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ jobs:
- name: Transpile source source with RubyNext
run: bundle exec rake nextify
- name: Run specs with RSpec
if: ${{ github.ref != 'refs/heads/main' }}
run: bundle exec rake spec
- name: Run specs with RSpec and upload test coverage
if: ${{ github.ref == 'refs/heads/main' }}
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: "${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}"
COVERAGE: true
with:
coverageCommand: bundle exec rake spec
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "simplecov"
SimpleCov.start
SimpleCov.start if ENV["COVERAGE"]

require "fileutils"
require "tmpdir"
Expand Down

0 comments on commit 11194a3

Please sign in to comment.