2020-12-22 19:47:52 +08:00
|
|
|
name: bazel
|
|
|
|
|
|
|
|
on:
|
|
|
|
push: {}
|
|
|
|
pull_request: {}
|
|
|
|
|
|
|
|
jobs:
|
2023-07-03 16:59:56 +08:00
|
|
|
build_and_test_default:
|
|
|
|
name: bazel.${{ matrix.os }}.${{ matrix.bzlmod && 'bzlmod' || 'no_bzlmod' }}
|
2022-06-14 00:45:20 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-07-31 17:51:37 +08:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2023-07-03 16:59:56 +08:00
|
|
|
bzlmod: [false, true]
|
2020-12-22 19:47:52 +08:00
|
|
|
steps:
|
2023-10-13 22:59:20 +08:00
|
|
|
- uses: actions/checkout@v4
|
2020-12-22 19:47:52 +08:00
|
|
|
|
2021-04-19 17:51:12 +08:00
|
|
|
- name: mount bazel cache
|
2024-08-02 17:56:57 +08:00
|
|
|
uses: actions/cache@v4
|
2021-04-19 17:51:12 +08:00
|
|
|
env:
|
|
|
|
cache-name: bazel-cache
|
|
|
|
with:
|
|
|
|
path: "~/.cache/bazel"
|
2022-06-14 00:45:20 +08:00
|
|
|
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.ref }}
|
2021-04-19 17:51:12 +08:00
|
|
|
restore-keys: |
|
2022-06-14 00:45:20 +08:00
|
|
|
${{ env.cache-name }}-${{ matrix.os }}-main
|
2020-12-22 19:47:52 +08:00
|
|
|
|
2021-04-19 17:51:12 +08:00
|
|
|
- name: build
|
|
|
|
run: |
|
2023-07-03 16:59:56 +08:00
|
|
|
bazel build ${{ matrix.bzlmod && '--enable_bzlmod' || '--noenable_bzlmod' }} //:benchmark //:benchmark_main //test/...
|
2021-04-27 01:26:33 +08:00
|
|
|
|
2021-04-19 17:51:12 +08:00
|
|
|
- name: test
|
|
|
|
run: |
|
2023-07-03 16:59:56 +08:00
|
|
|
bazel test ${{ matrix.bzlmod && '--enable_bzlmod' || '--noenable_bzlmod' }} --test_output=all //test/...
|