diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afcd4303a..20335c718 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,11 @@ jobs: run: | bun run test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + unit_tests: name: Unit tests runs-on: ubuntu-latest @@ -100,6 +105,11 @@ jobs: name: rspec-results-${{ github.job }}-${{ strategy.job-index }} path: tmp/rspec_${{ github.job }}_${{ strategy.job-index }}.junit.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + system_tests: name: System tests runs-on: ubuntu-latest @@ -144,6 +154,11 @@ jobs: name: rspec-results-${{ github.job }}-${{ strategy.job-index }} path: tmp/rspec_${{ github.job }}_${{ strategy.job-index }}.junit.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + save_test_reports: name: Save test reports needs: [unit_tests, system_tests] diff --git a/.simplecov b/.simplecov index 3c98b20b7..547890773 100644 --- a/.simplecov +++ b/.simplecov @@ -5,10 +5,15 @@ SimpleCov.start "rails" do command_name "RSpec process #{Process.pid}" - formatter SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::SimpleFormatter, - SimpleCov::Formatter::HTMLFormatter - ]) + if ENV["CI"] # codecov compatibility + require 'simplecov-cobertura' + formatter SimpleCov::Formatter::CoberturaFormatter + else + formatter SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::SimpleFormatter, + SimpleCov::Formatter::HTMLFormatter + ]) + end add_filter "/channels/" # not used groups.delete("Channels")