Skip to content

Commit

Permalink
CONFIG: Add codecov code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Mar 27, 2024
1 parent 67a9a9d commit 28a95b7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- 'Tests'
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ jobs:
run: swift build --build-tests --jobs ${{ env.BUILD_JOB_COUNT }} -Xswiftc -warnings-as-errors

- name: Test
run: swift test --skip-build --parallel --filter TMDbTests
run: swift test --filter TMDbTests --enable-code-coverage

- name: Prepare Code Coverage
run: |
xcrun llvm-cov \
export -format="lcov" \
.build/debug/TMDbPackageTests.xctest/Contents/MacOS/TMDbPackageTests \
-instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: info.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Build for Release
run: swift build -c release --jobs ${{ env.BUILD_JOB_COUNT }} -Xswiftc -warnings-as-errors
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ xcuserdata/
.vscode
*.xctestplan
docs/
info.lcov

0 comments on commit 28a95b7

Please sign in to comment.