This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (77 loc) · 2.49 KB
/
build_and_test.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
name: Build and Run all tests
# We use action's triggers 'push' and 'pull_request'.
# The strategy is the following: this action will be
# triggered on any push to 'main' branch and any pull
# request to any branch. Thus we avoid duplicate work-
# flows.
on:
push:
branches:
- "main"
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
sudo-command: "sudo"
# The macos runner doesn't have `docker` installed, so can't run
# `dazel`. Fall back to `bazel`.
bazel-command: "bazel"
bazel-config: ""
- os: ubuntu-latest
sudo-command: "sudo"
bazel-command: "dazel"
bazel-config: "--config=asan"
defaults:
run:
shell: bash
env:
GOOGLE_APPLICATION_CREDENTIALS: service_account_credentials.json
GOOGLE_REMOTE_CACHE: https://storage.googleapis.com/reboot-dev-eventuals-remote-cache
steps:
# Checkout the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Set up remote cache credentials
uses: jsdaniell/[email protected]
with:
name: ${{ env.GOOGLE_APPLICATION_CREDENTIALS }}
json: ${{ secrets.GCP_GITHUB_INFRA_REMOTE_CACHE_CREDENTIALS }}
# Install Dazel, so that we use the same build tooling in our Actions as
# we do on our workstations.
- name: Install Dazel
run: ${{ matrix.sudo-command }} pip3 install dazel
- name: Build
run: |
${{ matrix.bazel-command }} build \
${{ matrix.bazel-config }} \
--spawn_strategy=local \
-c dbg \
--strip="never" \
--remote_cache=$GOOGLE_REMOTE_CACHE \
--google_credentials=$GOOGLE_APPLICATION_CREDENTIALS \
--verbose_failures \
:grpc
- name: Test
run: |
${{ matrix.bazel-command }} test \
${{ matrix.bazel-config }} \
--spawn_strategy=local \
-c dbg \
--strip="never" \
--test_output=errors \
test:grpc \
--test_arg=--gtest_shuffle \
--test_arg=--gtest_repeat=100
- name: Debug using tmate (if failure)
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3