-
Notifications
You must be signed in to change notification settings - Fork 17
159 lines (149 loc) · 3.66 KB
/
bazel.yml
File metadata and controls
159 lines (149 loc) · 3.66 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Bazel CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
request:
runs-on: ubuntu-24.04
outputs:
run: ${{ steps.filter.outputs.run }}
steps:
- uses: envoyproxy/toolshed/actions/github/should-run@d10938876b114aa2a001b43b43158f1bf7008f1a
id: filter
with:
config: |
paths:
- BINS_VERSION.txt
- bazel/**
- .github/workflows/bazel.yml
- .github/workflows/_bazel.yml
test:
needs: request
if: >-
always()
&& fromJSON(needs.request.outputs.run || 'false')
uses: ./.github/workflows/_bazel.yml
with:
action: test
bazel-args: >-
--config=ci
${{ matrix.mode == 'bzlmod'
&& '--enable_bzlmod'
|| '' }}
bazel-mode: ${{ matrix.mode }}
bazel-path: bazel
targets: >-
//...
//sysroot:sysroots
strategy:
fail-fast: false
matrix:
mode:
- workspace
- bzlmod
build:
permissions:
contents: write
needs: request
if: >-
always()
&& fromJSON(needs.request.outputs.run || 'false')
uses: ./.github/workflows/_bazel.yml
with:
action: build
artifacts: |
compile/msan-llvm18.1.8-x86_64.tar.xz
compile/tsan-llvm18.1.8-x86_64.tar.xz
sysroot/sysroot-*.tar.xz
bazel-args: >-
--config=ci
${{ matrix.mode == 'bzlmod'
&& '--enable_bzlmod'
|| '' }}
bazel-path: bazel
bazel-mode: ${{ matrix.mode }}
targets: >-
//...
//sysroot:sysroots
upload: ${{ matrix.mode == 'workspace' }}
strategy:
fail-fast: false
matrix:
mode:
- workspace
- bzlmod
test-gcc:
needs: request
if: >-
always()
&& fromJSON(needs.request.outputs.run || 'false')
uses: ./.github/workflows/_bazel.yml
with:
action: build
bazel-args: >-
--config=ci
--config=gcc
${{ matrix.mode == 'bzlmod'
&& '--enable_bzlmod'
|| '' }}
bazel-mode: ${{ matrix.mode }}-gcc
bazel-path: bazel
targets: >-
//...
strategy:
fail-fast: false
matrix:
mode:
- workspace
- bzlmod
test-macos:
runs-on: macos-14
needs: request
if: >-
always()
&& fromJSON(needs.request.outputs.run || 'false')
strategy:
fail-fast: false
matrix:
mode:
- workspace
- bzlmod
steps:
- name: Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Bazel
uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3
- name: Bazel targets (build/${{ matrix.mode }}-macos)
run: |
exec bazel build \
--config=ci \
--config=macos \
${{ matrix.mode == 'bzlmod' && '--enable_bzlmod' || '' }} \
//...
working-directory: bazel
status:
runs-on: ubuntu-24.04
if: >-
always()
&& github.event_name == 'pull_request'
name: Bazel
needs:
- request
- test
- build
- test-gcc
- test-macos
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
fi
echo "All required jobs passed or were skipped"