diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..ff290cbd --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +ignore: + - 'Tests' \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 096c98f4..e51020d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore index efc63d83..bb6de5e0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ xcuserdata/ .vscode *.xctestplan docs/ +info.lcov