-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (91 loc) · 2.56 KB
/
integrate.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
90
91
92
93
name: integrate
on:
push:
branches:
- main
paths:
- "src/**"
- "include/**"
- ".github/**"
- "BUILD"
- "WORKSPACE"
- ".bazelrc"
- ".bazelversion"
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
matrix:
name: "GCC"
runs-on: ubuntu-24.04
strategy:
matrix:
GCC: [12, 13]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
env:
cache-name: bazel-${{ matrix.GCC }}
with:
path: bazel-disk
key: ${{ github.workflow }}-${{ env.cache-name }}-${{ runner.os }}-${{github.sha}}
restore-keys: ${{ github.workflow }}-${{ env.cache-name }}-${{ runner.os }}-
save-always: true
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: false
repository-cache: false
- name: run build
env:
CC: gcc-${{ matrix.GCC }}
CXX: g++-${{ matrix.GCC }}
run: |
bazel test --disk_cache=bazel-disk //...
coverage:
name: code coverage
runs-on: ubuntu-24.04
needs: [matrix]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
env:
cache-name: bazel-coverage
with:
path: bazel-disk
key: ${{ github.workflow }}-${{ env.cache-name }}-${{ runner.os }}-${{github.sha}}
restore-keys: ${{ github.workflow }}-${{ env.cache-name }}-${{ runner.os }}-
save-always: true
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: false
repository-cache: true
- run: sudo apt update
- run: sudo apt install lcov
- run: sudo apt install yasm
- run: sudo apt install nasm
- name: run coverage
env:
CC: gcc-12
CXX: g++-12
run: |
bazel coverage --disk_cache=bazel-disk --instrument_test_targets --combined_report=lcov //...
genhtml --output coverage "./bazel-out/_coverage/_coverage_report.dat"
- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage
publish_branch: coverage
user_name: "liubang"
user_email: "[email protected]"