ci: upload coverage reports to codecov

This commit is contained in:
Colin Darie 2024-04-22 15:00:40 +02:00
parent fa569c8bb4
commit 2bf53abcf6
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
2 changed files with 24 additions and 4 deletions

View file

@ -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]

View file

@ -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")