-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (85 loc) · 2.54 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
tags:
- v*
branches:
- main
pull_request:
merge_group:
# none-all, which doesn't exist, but
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow
# implies that the token still gets created. Elsewhere we learn that any
# permission not mentioned here gets turned to `none`.
permissions:
actions: none
jobs:
test:
strategy:
matrix:
compiler: [ gcc, clang ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt-get install -y \
curl \
scons \
bison \
flex \
dejagnu \
lcov \
${{ matrix.compiler }}
- name: test
run: scons coverage=yes check coverage.info
env:
CC: ${{ matrix.compiler }}
- uses: codecov/codecov-action@v4
with:
file: coverage.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: distcheck
run: scons distcheck
env:
CC: ${{ matrix.compiler }}
bazel_test:
runs-on: ubuntu-latest
permissions:
# publish-unit-test-result-action
# writes a comment to the PR
pull-requests: write
# and writes to the checks API
checks: write
steps:
- uses: actions/checkout@v4
- name: mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel-${{ hashFiles('WORKSPACE', 'MODULE.bazel' }}
- name: install dependencies
run: |
sudo apt-get install -y \
dejagnu \
gcc \
llvm
dpkg -S llvm-cov
- name: bazel test
run: bazel coverage --explain=explain.out -s --test_env=VERBOSE_COVERAGE=1 --test_env=DISPLAY_LCOV_CMD=1 --test_output=all --combined_report=lcov --instrument_test_targets --nocache_test_results --instrumentation_filter="^//" //...
- name: copy test results into workspace
if: always()
run: |
cp -Lpr $(bazel info bazel-testlogs)/ test-results
cp -Lpr $(bazel info output_path)/_coverage/_coverage_report.dat coverage_report.dat
- uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/test.xml
- uses: codecov/codecov-action@v4
with:
file: coverage_report.dat
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}