|
1 | 1 | name: CI |
2 | 2 | on: |
| 3 | + push: |
3 | 4 | pull_request: |
4 | 5 | jobs: |
5 | 6 | lint: |
|
27 | 28 | - name: build (LLVM ${{ matrix.llvm_version }}) |
28 | 29 | # Run the build manually in `nix develop` to keep non-outputs around |
29 | 30 | run: | |
30 | | - nix develop .#oid-llvm${{ matrix.llvm_version }} --command cmake -B build -G Ninja -DWITH_FLAKY_TESTS=Off -DFORCE_BOOST_STATIC=Off |
| 31 | + nix develop .#oid-llvm${{ matrix.llvm_version }} --command cmake -B build -G Ninja \ |
| 32 | + -DWITH_FLAKY_TESTS=Off \ |
| 33 | + -DFORCE_BOOST_STATIC=Off \ |
| 34 | + -DCODE_COVERAGE=On |
31 | 35 | nix develop .#oid-llvm${{ matrix.llvm_version }} --command ninja -C build |
32 | 36 | - name: test (LLVM ${{ matrix.llvm_version }}) |
33 | 37 | env: |
|
46 | 50 | --repeat until-pass:3 \ |
47 | 51 | --exclude-from-file ../../.github/workflows/tests_failing_under_nix.txt \ |
48 | 52 | --output-junit results.xml |
| 53 | +
|
| 54 | + - name: prepare coverage |
| 55 | + run: | |
| 56 | + nix run nixpkgs#lcov -- --capture --directory . --filter branch --no-external --ignore-errors mismatch --ignore-errors source --rc lcov_branch_coverage=1 --output-file coverage.info |
| 57 | + # Empirically, extract-then-remove is faster than remove-then-extract |
| 58 | + nix run nixpkgs#lcov -- --extract coverage.info '/tmp/object-introspection/*' --rc lcov_branch_coverage=1 --output-file coverage.info |
| 59 | + nix run nixpkgs#lcov -- --remove coverage.info '/tmp/object-introspection/build/*' '/tmp/object-introspection/extern/*' --rc lcov_branch_coverage=1 --output-file coverage.info |
| 60 | + nix run nixpkgs#lcov -- --list --rc lcov_branch_coverage=1 coverage.info |
| 61 | +
|
| 62 | + - name: upload coverage |
| 63 | + continue-on-error: true |
| 64 | + uses: coverallsapp/github-action@v2 |
| 65 | + with: |
| 66 | + flag-name: run-${{ join(matrix.*, '-') }} |
| 67 | + parallel: true |
| 68 | + |
49 | 69 | - name: upload results |
50 | 70 | uses: actions/upload-artifact@v4 |
51 | 71 | if: success() || failure() |
52 | 72 | with: |
53 | 73 | name: test-results-${{ matrix.llvm_version }} |
54 | 74 | path: build/test/results.xml |
| 75 | + |
| 76 | + finalise-coverage: |
| 77 | + needs: build-test |
| 78 | + if: ${{ always() }} |
| 79 | + runs-on: ubuntu-latest |
| 80 | + steps: |
| 81 | + - name: finalise coverage |
| 82 | + uses: coverallsapp/github-action@v2 |
| 83 | + with: |
| 84 | + parallel-finished: true |
| 85 | + carryforward: "run-15,run-16" |
| 86 | + |
0 commit comments