forked from BamPeers/rust-ci-github-actions-workflow
-
Notifications
You must be signed in to change notification settings - Fork 1
335 lines (306 loc) · 9.99 KB
/
cross-build.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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
name: Cross Build
on:
pull_request:
push:
branches:
- main
workflow_run:
workflows: ["Test with Code Coverage"]
branches: [main]
types:
- completed
jobs:
test:
name: ${{ matrix.os.name }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
os:
- arch: ubuntu-latest
name: Ubuntu
- arch: macos-latest
name: Mac OS X
- arch: windows-latest
name: Windows
rust: [stable]
runs-on: ${{ matrix.os.arch }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
objects.githubusercontent.com:443
raw.githubusercontent.com:443
static.rust-lang.org:443
static.crates.io:443
index.crates.io:443
azure.archive.ubuntu.com:80
changelogs.ubuntu.com:443
esm.ubuntu.com:443
security.ubuntu.com:80
packages.microsoft.com:443
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@315e265cd78dad1e1dcf3a5074f6d6c47029d5aa # master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
- name: Run cargo test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo test --all-features
freebsd:
name: FreeBSD
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
objects.githubusercontent.com:443
raw.githubusercontent.com:443
static.rust-lang.org:443
static.crates.io:443
index.crates.io:443
azure.archive.ubuntu.com:80
changelogs.ubuntu.com:443
esm.ubuntu.com:443
packages.microsoft.com
0.freebsd.pool.ntp.org:443
2.freebsd.pool.ntp.org:443
pkg.freebsd.org:443
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: FreeBSD
uses: vmactions/freebsd-vm@debf37ca7b7fa40e19c542ef7ba30d6054a706a4 # v1.1.5
with:
usesh: true
sync: rsync
copyback: false
prepare: |
mkdir -p /usr/local/etc/pkg/repos
cat << EOF > /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
url: "http://pkg.freebsd.org/\${ABI}/latest",
mirror_type: "none",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
EOF
pkg update -f ; pkg install -y curl rust-nightly
run: |
pwd
ls -lah
whoami
env
freebsd-version
sysctl hw.model
sysctl hw.ncpu
sysctl hw.physmem
sysctl hw.usermem
cargo test --all-features
openbsd:
name: OpenBSD
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
objects.githubusercontent.com:443
raw.githubusercontent.com:443
static.rust-lang.org:443
static.crates.io:443
index.crates.io:443
azure.archive.ubuntu.com:80
changelogs.ubuntu.com:443
esm.ubuntu.com:443
packages.microsoft.com:443
cdn.openbsd.org
pool.ntp.org:443
time.cloudflare.com:443
www.google.com:443
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: OpenBSD
uses: vmactions/openbsd-vm@0cfe06e734a0ea3a546fca7ebf200b984b94d58a # v1.1.4
with:
usesh: true
sync: rsync
copyback: false
prepare: |
pkg_add curl rust
run: |
pwd
ls -lah
whoami
env
cargo test --all-features
netbsd:
name: NetBSD
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
objects.githubusercontent.com:443
raw.githubusercontent.com:443
static.rust-lang.org:443
static.crates.io:443
index.crates.io:443
archive.ubuntu.com:80
azure.archive.ubuntu.com:80
changelogs.ubuntu.com:443
esm.ubuntu.com:443
packages.microsoft.com:443
security.ubuntu.com:80
2.netbsd.pool.ntp.org:443
cdn.NetBSD.org:443
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: NetBSD
uses: vmactions/netbsd-vm@7c9086fdb4cc1aa814cda6e305390c2b966551a9 # v1.1.4
with:
usesh: true
sync: rsync
copyback: false
prepare: |
/usr/sbin/pkg_add pkgin
pkgin -y install curl rust
run: |
pwd
ls -lah
whoami
env
cargo test --all-features
alpine:
name: Alpine
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
static.rust-lang.org:443
static.crates.io:443
index.crates.io:443
dl-cdn.alpinelinux.org:80
gitlab.alpinelinux.org:443
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup
uses: jirutka/setup-alpine@092137b2b59839555e7432042a9533c64ed482a4 # v1
with:
branch: edge
- name: Run tests
run: |
apk add cargo
cargo test --all-features
shell: alpine.sh --root {0}
arch:
name: Arch
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
api.deps.dev:443
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
objects.githubusercontent.com:443
raw.githubusercontent.com:443
static.rust-lang.org:443
static.crates.io:443
index.crates.io:443
2.netbsd.pool.ntp.org:443
archlinux.org:443
geo.mirror.pkgbuild.com:443
openpgpkey.archlinux.org:443
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup
uses: RangHo/setup-arch@e8cd607443653e6fb211e402d20a9cc75b0ad5f2 # main
with:
packages: "rust"
- name: Run tests
run: |
cargo test --all-features
# TODO:
# - OpenSUSE
# - Rocky Linux
# - Fedora
# - Gentoo
# - Slackware