update #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]" |