-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (83 loc) · 2.17 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
name: integrate
on:
push:
branches:
- main
paths:
- "src/**"
- "include/**"
- ".github/**"
- "BUILD"
- "WORKSPACE"
- ".bazelrc"
- ".bazelversion"
pull_request:
branches:
- main
workflow_dispatch:
jobs:
matrix:
name: "GCC"
runs-on: ubuntu-22.04
strategy:
matrix:
GCC: [9, 10, 11]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: "^1.22.0"
- uses: actions/cache@v3
env:
cache-name: bazel-${{ matrix.GCC }}
with:
path: ~/.cache/bazelisk
key: ${{ env.cache-name }}-${{ runner.os }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}
- run: go install github.com/bazelbuild/bazelisk@latest
- name: run build
env:
CC: gcc-${{ matrix.GCC }}
CXX: g++-${{ matrix.GCC }}
run: |
bazelisk test //...
coverage:
name: code coverage
runs-on: ubuntu-latest
needs: [matrix]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: "^1.22.0"
- uses: actions/cache@v3
env:
cache-name: bazel-coverage
with:
path: ~/.cache/bazelisk
key: ${{ env.cache-name }}-${{ runner.os }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}
- run: go install github.com/bazelbuild/bazelisk@latest
- name: run build
env:
CC: gcc-11
CXX: g++-11
run: |
sudo apt install lcov -y
bazelisk coverage --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]"