-
Notifications
You must be signed in to change notification settings - Fork 14
43 lines (37 loc) · 1.39 KB
/
bazel_tests.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
name: Bazel Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
ubuntu:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
include:
- { NAME: "Debug", CC: clang, os: ubuntu-20.04, flags: "-c dbg" }
- { NAME: "Optmized", CC: clang, os: ubuntu-20.04, flags: "-c opt" }
- { NAME: "GCC Optimized", CC: gcc, os: ubuntu-20.04, flags: "-c opt" }
- { NAME: "ASAN", CC: clang, os: ubuntu-20.04, flags: "--config=asan -c dbg" }
- { NAME: "UBSAN", CC: clang, os: ubuntu-20.04, flags: "--config=ubsan -c dbg", install: "libunwind-dev" }
- { NAME: "macOS", CC: clang, os: macos-11, flags: "" }
name: Bazel ${{ matrix.NAME }}
steps:
- uses: actions/checkout@v2
- name: Setup Bazel
run: |
echo "BAZEL=bazel" >> $GITHUB_ENV
echo "USE_BAZEL_VERSION=6.4.0" >> $GITHUB_ENV
- name: Setup Bazel (macOS)
if: runner.os == 'macOS'
run: echo "BAZEL=bazelisk" >> $GITHUB_ENV
- name: Install dependencies
run: sudo apt update && sudo apt install -y ${{ matrix.install }}
if: matrix.install != ''
- name: Run tests
run: cd ${{ github.workspace }} && CC=${{ matrix.CC }} ${{ env.BAZEL }} test --test_output=errors ... ${{ matrix.flags }}