Skip to content

Commit cf8b1a4

Browse files
committed
ci: enable coverage in github actions
1 parent 2ac943c commit cf8b1a4

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ jobs:
2727
- name: build (LLVM ${{ matrix.llvm_version }})
2828
# Run the build manually in `nix develop` to keep non-outputs around
2929
run: |
30-
nix develop .#oid-llvm${{ matrix.llvm_version }} --command cmake -B build -G Ninja -DWITH_FLAKY_TESTS=Off -DFORCE_BOOST_STATIC=Off
30+
nix develop .#oid-llvm${{ matrix.llvm_version }} --command cmake -B build -G Ninja \
31+
-DWITH_FLAKY_TESTS=Off \
32+
-DFORCE_BOOST_STATIC=Off \
33+
-DCODE_COVERAGE=On
3134
nix develop .#oid-llvm${{ matrix.llvm_version }} --command ninja -C build
3235
- name: test (LLVM ${{ matrix.llvm_version }})
3336
env:
@@ -46,9 +49,29 @@ jobs:
4649
--repeat until-pass:3 \
4750
--exclude-from-file ../../.github/workflows/tests_failing_under_nix.txt \
4851
--output-junit results.xml
52+
53+
- name: upload coverage
54+
continue-on-error: true
55+
uses: coverallsapp/github-action@v2
56+
with:
57+
flag-name: run-${{ join(matrix.*, '-') }}
58+
parallel: true
59+
4960
- name: upload results
5061
uses: actions/upload-artifact@v4
5162
if: success() || failure()
5263
with:
5364
name: test-results-${{ matrix.llvm_version }}
5465
path: build/test/results.xml
66+
67+
finalise-coverage:
68+
needs: build-test
69+
if: ${{ always() }}
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: finalise coverage
73+
uses: coverallsapp/github-action@v2
74+
with:
75+
parallel-finished: true
76+
carryforward: "run-15,run-16"
77+

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
in
109109
pkgs.mkShell.override { stdenv = llvmPackages.stdenv; } {
110110
inputsFrom = [ self.packages.${system}."oid-llvm${toString llvmVersion}" ];
111-
buildInputs = [ ];
111+
buildInputs = with pkgs; [ lcov ];
112112
};
113113
in
114114
{

0 commit comments

Comments
 (0)