Skip to content

Commit

Permalink
Adds coverage reporting. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams authored Feb 28, 2024
1 parent 409cf0c commit 85f52ab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- Tests
26 changes: 20 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Build and run devcontainer task
uses: devcontainers/[email protected]
with:
runCmd: swift test -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}
runCmd: swift test --parallel -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}

build-native:
name: "Native: ${{ matrix.host.os }}/${{ matrix.configuration }}"
Expand Down Expand Up @@ -69,12 +69,26 @@ jobs:
- name: Configure pkgconfig
run: sudo ./Tools/make-pkgconfig.sh /usr/local/lib/pkgconfig/llvm.pc

- name: Build
run: swift build -v -c ${{ matrix.configuration }}
- name: Test
run: swift test --enable-code-coverage -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}

- name: Export Coverage
run: |
dot_os=(.build/${{ matrix.configuration }}/*.build/**/*.o)
bin_params=("${dot_os[0]}")
for o in "${dot_os[@]:1}"; do
bin_params+=("-object" "${o}")
done
llvm-cov export -format="lcov" -instr-profile "$(swift test -c ${{ matrix.configuration }} --show-codecov-path | xargs dirname)"/default.profdata "${bin_params[@]}" > info.lcov
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: ${{ matrix.host.os }},${{ matrix.configuration }}


- name: Test
run: swift test -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}

build-native-windows:
name: "Native: windows-latest/debug"
strategy:
Expand Down

0 comments on commit 85f52ab

Please sign in to comment.