Skip to content

Commit

Permalink
CONFIG: Upload test results to codecov on CI build (#220)
Browse files Browse the repository at this point in the history
* CONFIG: Upload test results to codecov

* WIP
  • Loading branch information
adamayoung authored Nov 28, 2024
1 parent 4b230a1 commit 5b99bf4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: swift build --build-tests -Xswiftc -warnings-as-errors

- name: Test
run: swift test --filter TMDbTests --enable-code-coverage
run: swift test --filter TMDbTests --enable-code-coverage --xunit-output junit.xml

- name: Prepare Code Coverage
run: |
Expand All @@ -40,6 +40,16 @@ jobs:
.build/debug/TMDbPackageTests.xctest/Contents/MacOS/TMDbPackageTests \
-instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
file: ./junit-swift-testing.xml
flags: unit-tests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ jobs:
run: swift build --build-tests

- name: Test
run: swift test --skip-build --filter TMDbIntegrationTests
run: swift test --skip-build --filter TMDbIntegrationTests --xunit-output junit.xml
env:
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }}
TMDB_USERNAME: ${{ secrets.TMDB_USERNAME }}
TMDB_PASSWORD: ${{ secrets.TMDB_PASSWORD }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
file: ./junit-swift-testing.xml
flags: integration-tests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ xcuserdata/
*.xctestplan
docs/
info.lcov
default.profraw
default.profraw
junit-swift-testing.xml

0 comments on commit 5b99bf4

Please sign in to comment.