forked from bottlerocket-os/bottlerocket
-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (200 loc) · 7.24 KB
/
build.yml
File metadata and controls
203 lines (200 loc) · 7.24 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Build
on:
pull_request:
branches: [develop]
# Here we list file types that don't affect the build and don't need to use
# up our Actions runners.
paths-ignore:
# draw.io (diagrams.net) files, the source of png images for docs
- '**.drawio'
# Example configuration files
- '**.example'
# Markdown documentation
- '**.md'
# Images for documentation
- '**.png'
# Templates for README files
- '**.tpl'
# Sample config files and OpenAPI docs
- '**.yaml'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
# When Go packages are built, buildsys will vendor in dependent Go code for
# that package and bundle it up in a tarball. This env variable is consumed
# and used to configure Go to directly download code from its upstream source.
# This is a useful early signal during GitHub actions to see if there are
# upstream Go code problems.
GOPROXY: direct
jobs:
build:
runs-on:
group: bottlerocket
labels: bottlerocket_ubuntu-latest_32-core
continue-on-error: ${{ matrix.supported }}
strategy:
matrix:
variant: [aws-k8s-1.22, aws-k8s-1.23, aws-k8s-1.24, aws-k8s-1.25, aws-k8s-1.26, aws-ecs-1]
arch: [x86_64, aarch64]
supported: [true]
fetch-upstream: ["false"]
include:
- variant: aws-dev
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: vmware-dev
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: metal-dev
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: metal-k8s-1.22
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: metal-k8s-1.23
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: metal-k8s-1.24
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: metal-k8s-1.25
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: metal-k8s-1.26
arch: x86_64
supported: false
fetch-upstream: "false"
- variant: vmware-k8s-1.22
arch: x86_64
supported: true
fetch-upstream: "false"
- variant: vmware-k8s-1.23
arch: x86_64
supported: true
fetch-upstream: "false"
- variant: vmware-k8s-1.24
arch: x86_64
supported: true
fetch-upstream: "false"
- variant: vmware-k8s-1.25
arch: x86_64
supported: true
fetch-upstream: "false"
- variant: vmware-k8s-1.26
arch: x86_64
supported: true
fetch-upstream: "false"
- variant: aws-k8s-1.22-nvidia
arch: x86_64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.22-nvidia
arch: aarch64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.23-nvidia
arch: x86_64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.23-nvidia
arch: aarch64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.24-nvidia
arch: x86_64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.24-nvidia
arch: aarch64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.25-nvidia
arch: x86_64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.25-nvidia
arch: aarch64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.26-nvidia
arch: x86_64
supported: true
fetch-upstream: "true"
- variant: aws-k8s-1.26-nvidia
arch: aarch64
supported: true
fetch-upstream: "true"
- variant: aws-ecs-1-nvidia
arch: x86_64
supported: true
fetch-upstream: "true"
- variant: aws-ecs-1-nvidia
arch: aarch64
supported: true
fetch-upstream: "true"
fail-fast: false
steps:
- name: Preflight step to set up the runner
run: |
echo "OS_ARCH=`uname -m`" >> $GITHUB_ENV
sudo apt -y install build-essential openssl libssl-dev pkg-config liblz4-tool
- uses: actions/checkout@v3
# Cache `cargo-make`, `cargo-cache`, `cargo-sweep`
- uses: actions/cache@v3
with:
path: |
~/.cargo
key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}
# Cache first-party rust code crate dependencies
- uses: actions/cache@v3
with:
path: |
.cargo
key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('sources/Cargo.lock') }}-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: |
${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('sources/Cargo.lock') }}
# Cache 'tools/' dependencies and build artifacts
- uses: actions/cache@v3
with:
path: |
tools/bin
tools/.crates.toml
tools/.crates2.json
tools/target
key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('tools/Cargo.lock') }}-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: |
${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('tools/Cargo.lock') }}
- run: rustup component add rustfmt
- run: cargo install --version 0.36.0 cargo-make
- run: cargo install --version 0.6.2 cargo-sweep
- run: |
cargo sweep -i -r tools/
cargo sweep -t 7 -r tools/
- if: contains(matrix.variant, 'nvidia')
run: |
cat <<-EOF > Licenses.toml
[nvidia]
spdx-id = "LICENSE-LicenseRef-NVIDIA-Customer"
licenses = [
{ path = "NVIDIA", license-url = "https://www.nvidia.com/en-us/drivers/nvidia-license/" }
]
EOF
- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} unit-tests
- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-fmt
# Avoid running Go lint check via `cargo make check-lints` since there's a separate golangci-lint workflow
- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-clippy
- run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-shell
- run: |
cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} \
-e BUILDSYS_ARCH=${{ matrix.arch }} \
-e BUILDSYS_JOBS=12 \
-e BUILDSYS_UPSTREAM_SOURCE_FALLBACK=${{ matrix.fetch-upstream }} \
-e BUILDSYS_UPSTREAM_LICENSE_FETCH=${{ matrix.fetch-upstream }}