-
Notifications
You must be signed in to change notification settings - Fork 74
131 lines (128 loc) · 5.77 KB
/
bazel_test_centipede.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Bazel Test Centipede
on:
push:
branches:
- main
pull_request:
schedule:
# Triggered nightly at 8:00 AM UTC to reset the Bazel cache.
- cron: '0 8 * * *'
workflow_dispatch:
jobs:
run_tests:
name: Run Centipede tests
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
config: ['default', 'noriegeli', 'asan']
steps:
# TODO(lszekeres): Remove once the following is fixed:
# https://github.com/actions/runner-images/issues/9491
- name: Reduce ASLR entropy as a temporary workaround
run: |
sudo sysctl -w vm.mmap_rnd_bits=28
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -yq \
clang llvm libssl-dev
- name: Restore latest cache
uses: actions/cache/restore@v4
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-${{ matrix.config }}
restore-keys: bazel-centipede-cache-${{ matrix.config }}-
- name: Run unit tests
if: matrix.config == 'default'
run: |
bazel test --local_test_jobs=1 --test_output=streamed centipede:all
- name: Run e2e tests
if: matrix.config == 'default'
run: |
bazel test --test_output=errors centipede/testing:instrumentation_test centipede/testing:runner_test
- name: Run puzzles
if: matrix.config == 'default'
run: |
bazel test --test_output=errors centipede/puzzles:all
- name: Run puzzles with ASAN
if: matrix.config == 'asan'
run: |
bazel test --test_output=errors --linkopt=-fsanitize=address --copt=-fsanitize=address --test_env=ASAN_OPTIONS=detect_leaks=0 centipede/puzzles:all
- name: Run unit tests without Riegeli
if: matrix.config == 'noriegeli'
run: |
bazel test --no//fuzztest:use_riegeli --local_test_jobs=1 --test_output=streamed centipede:all
- name: Run e2e tests without Riegeli
if: matrix.config == 'noriegeli'
run: |
bazel test --no//fuzztest:use_riegeli --test_output=errors centipede/testing:instrumentation_test centipede/testing:runner_test
- name: Run puzzles without Riegeli
if: matrix.config == 'noriegeli'
run: |
bazel test --no//fuzztest:use_riegeli --test_output=errors centipede/puzzles:all
- name: Run puzzles without Riegeli with ASAN
if: matrix.config == 'noriegeli'
run: |
bazel test --no//fuzztest:use_riegeli --test_output=errors --linkopt=-fsanitize=address --copt=-fsanitize=address --test_env=ASAN_OPTIONS=detect_leaks=0 --platform_suffix=asan centipede/puzzles:all
- name: Save new cache based on main
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-${{ matrix.config }}-${{ github.run_id }}
run_tests_mac:
name: Run Centipede tests (MacOS)
runs-on: macos-13
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Restore latest cache
uses: actions/cache/restore@v4
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-mac
restore-keys: bazel-centipede-cache-mac-
- name: Add LLVM symbolizer to path
run: |
ln -s $(brew --prefix llvm@15)/bin/llvm-symbolizer /usr/local/bin
- name: Run unit tests
if: ${{ !cancelled() }}
run: |
# Timed wait is delayed for unknown reasons in MacOS for a few testing
# environments, thus disabling a few related non-critical tests.
bazel --output_user_root="${HOME}/.cache/bazel" test --local_test_jobs=1 --test_output=errors --no//fuzztest:use_riegeli -- centipede:all -centipede:periodic_action_test -centipede:rusage_profiler_test && \
bazel --output_user_root="${HOME}/.cache/bazel" test --local_test_jobs=1 --test_output=errors --no//fuzztest:use_riegeli --test_filter='-*ValidateTimelapseSnapshots' -- centipede:rusage_profiler_test
- name: Run e2e tests without Riegeli
if: ${{ !cancelled() }}
run: |
bazel --output_user_root="${HOME}/.cache/bazel" test --test_output=errors --no//fuzztest:use_riegeli centipede/testing:instrumentation_test centipede/testing:runner_test centipede/testing:multi_dso_test
- name: Run puzzles without Riegeli
if: ${{ !cancelled() }}
run: |
bazel --output_user_root="${HOME}/.cache/bazel" test --test_output=errors --no//fuzztest:use_riegeli centipede/puzzles:all
- name: Run puzzles without Riegeli with ASAN
if: ${{ !cancelled() }}
run: |
bazel --output_user_root="${HOME}/.cache/bazel" test --test_output=errors --no//fuzztest:use_riegeli --linkopt=-fsanitize=address --copt=-fsanitize=address --test_env=ASAN_OPTIONS=detect_leaks=0 --platform_suffix=asan centipede/puzzles:all
- name: Save new cache based on main
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: "~/.cache/bazel"
key: bazel-centipede-cache-mac-${{ github.run_id }}