From 1ba3cc91149822cd9435eefe370e13c39a364b83 Mon Sep 17 00:00:00 2001 From: Jeremy Jackson Date: Sat, 22 Jul 2023 15:10:06 -0600 Subject: [PATCH 1/2] Adds test coverage reporter --- .github/workflows/ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8e27b3..c8acc76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,26 +9,27 @@ defaults: jobs: specs: - name: 'run-specs' - # skip on [ci skip] and do not run 2 on push and interal PR + name: 'specs' + # skip on [ci skip] and do not run 2 on push and internal PR if: (contains(github.event.commits[0].message, '[ci skip]') == false) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) continue-on-error: ${{ matrix.allow_failure || false }} runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1.0 bundler-cache: true - + - 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: run specs run: | bundle exec rake - - # needs the right code climate reporter id - # - name: Test & publish code coverage - # uses: paambaati/codeclimate-action@v3.0.0 - # env: - # CC_TEST_REPORTER_ID: + - name: Publish code coverage + run: | + export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" + ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}} From 4f6911dedaa8a4081b1bf02e062266173a381687 Mon Sep 17 00:00:00 2001 From: Jeremy Jackson Date: Sat, 22 Jul 2023 15:23:14 -0600 Subject: [PATCH 2/2] Adjust simplecov version --- .github/workflows/ci.yml | 2 +- Gemfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8acc76..48dab95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: 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: run specs + - name: Run specs run: | bundle exec rake - name: Publish code coverage diff --git a/Gemfile b/Gemfile index d00a0e0..8d31db1 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,6 @@ gem "rubocop-rails", require: false group :test do gem "rspec" - gem "simplecov" + gem "simplecov", "< 0.18" gem "sqlite3" end