-
Notifications
You must be signed in to change notification settings - Fork 11
132 lines (131 loc) · 4.12 KB
/
Copy pathci.yaml
File metadata and controls
132 lines (131 loc) · 4.12 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
---
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
actions: write
jobs:
test:
name: test (${{ matrix.bazel-version }}, ${{ matrix.os }}, ${{ matrix.external_dependency_system }})
runs-on: ${{ matrix.os }}-latest
env:
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
BUILDBUDDY_RW_API_KEY: ${{ secrets.BUILDBUDDY_RW_API_KEY }}
strategy:
fail-fast: false
matrix:
include:
- bazel-version: 7.x
os: ubuntu
external_dependency_system: bzlmod
flags: --enable_bzlmod
- bazel-version: 7.x
os: ubuntu
external_dependency_system: workspace
flags:
- bazel-version: 7.x
os: macos
external_dependency_system: bzlmod
flags: --enable_bzlmod
- bazel-version: 7.x
os: macos
external_dependency_system: workspace
flags:
- bazel-version: 8.x
os: ubuntu
external_dependency_system: bzlmod
flags:
- bazel-version: 8.x
os: ubuntu
external_dependency_system: workspace
flags: --enable_workspace
- bazel-version: 8.x
os: macos
external_dependency_system: bzlmod
flags:
- bazel-version: 9.x
os: ubuntu
external_dependency_system: bzlmod
flags:
- bazel-version: 9.x
os: macos
external_dependency_system: bzlmod
flags:
steps:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelrc: |
${{ env.BUILDBUDDY_RW_API_KEY && format('build --remote_header=x-buildbuddy-api-key={0}', env.BUILDBUDDY_RW_API_KEY) }}
common ${{ matrix.flags }}
# Don't want to bother with hundreds of lines of Workspace setup for the rules_pycross compat test
- if: matrix.external_dependency_system == 'workspace'
run: echo "tests/rules_pycross" >> .bazelignore
- run: bazel test //...
examples:
runs-on: ubuntu-latest
env:
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
strategy:
fail-fast: false
matrix:
bazel-version: [7.x, 8.x, 9.x]
steps:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-examples
repository-cache: true
- run: examples/integration_test.sh
toolchains:
name: toolchains (${{ matrix.cpu }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cpu: [aarch64, arm, armv7, i386, x86_64]
steps:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-toolchains
repository-cache: true
# Makes sure every registered toolchain (including the deprecated default one) resolves and
# points at an AppImage runtime repo that actually gets declared.
- run: bazel build --platforms=//:linux_${{ matrix.cpu }} //appimage:all
determinism:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
repository-cache: true
- run: tests/determinism/reproducible_shas.sh
- if: failure()
uses: actions/upload-artifact@v4
with:
name: determinism-artifacts
path: ${{ runner.temp }}/determinism-test/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
required:
runs-on: ubuntu-latest
needs: [test, examples, toolchains, determinism, lint] # this automatically depends on all matrix jobs
if: always() # Never skip, even if dependencies failed (which would otherwise make this one *skip*)
steps:
- name: Fail if any ancestor job failed
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1