-
Notifications
You must be signed in to change notification settings - Fork 7
80 lines (77 loc) · 2.75 KB
/
bazel-test.yaml
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
# Copyright 2021, 2022, 2023, 2024 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
#
# https://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: Run Bazel tests
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
test:
name: Test
strategy:
matrix:
# We don’t use the GitHub matrix support for the Emacs toolchain to
# allow Bazel to cache intermediate results between the test runs.
bazel: [7.0.0, 7.4.1, latest]
os: [ubuntu-latest, macos-latest, windows-latest]
cc: [gcc, clang, msvc]
exclude:
# Visual C++ works only on Windows. Windows doesn’t use the CC
# environment variable and always uses Visual C++ by default.
- os: ubuntu-latest
cc: msvc
- os: macos-latest
cc: msvc
- os: windows-latest
cc: gcc
- os: windows-latest
cc: clang
# Exclude non-default compilers for now. We should add them later.
- os: macos-latest
cc: gcc
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up workspace
uses: ./.github/actions/set-up
with:
bazel-version: ${{matrix.bazel}}
cc: ${{matrix.cc}}
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Set lockfile mode
# The lockfile format differs between the Bazel versions, so only for
# one version --lockfile_mode=error can work. --lockfile_mode=update
# would be useless since we never use the updated lockfiles, so switch
# lockfiles off entirely in other Bazel versions.
shell: bash
run: >-
echo common
--lockfile_mode=${{matrix.bazel == 'latest' && 'error' || 'off'}}>>
github.bazelrc
- name: Run Bazel tests
shell: pwsh
run: python build.py --profiles='${{runner.temp}}/profiles' -- check
- name: Upload profiles
uses: actions/upload-artifact@v4
with:
name: >-
profiles for Bazel version ${{matrix.bazel}} on ${{runner.os}}
compiled with ${{matrix.cc}}
path: ${{runner.temp}}/profiles/*.json.gz
if-no-files-found: ignore