-
Notifications
You must be signed in to change notification settings - Fork 127
731 lines (707 loc) · 26.7 KB
/
cross.yml
File metadata and controls
731 lines (707 loc) · 26.7 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
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
name: cross
on:
push:
branches:
- "*"
- "!generate/aws-lc-*"
pull_request:
branches:
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
# We can pin the version if nightly is too unstable.
# Otherwise, we test against the latest version.
RUST_NIGHTLY_TOOLCHAIN: nightly
DEBIAN_FRONTEND: noninteractive
permissions:
contents: read
jobs:
aws-lc-rs-cross-test:
if: github.repository_owner == 'aws'
name: cross tests ${{ matrix.target[0] }}
runs-on: ubuntu-22.04
env:
# The flag below is set to avoid the following error with GCC 11.4.0 on the riscv64 platform:
# /home/runner/work/aws-lc-rs/aws-lc-rs/aws-lc-sys/aws-lc/crypto/pem/pem_lib.c:707:11: error: 'strncmp' of strings of length 1 and 9 and bound of 9 evaluates to nonzero [-Werror=string-compare]
# 707 | if (strncmp(buf, "-----END ", 9) == 0) {
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
AWS_LC_SYS_CFLAGS_riscv64gc_unknown_linux_gnu: '-Wno-string-compare'
AWS_LC_SYS_EXTERNAL_BINDGEN: '0' # disallow external bindgen
strategy:
fail-fast: false
matrix:
# The target arrays are structured as:
# [0]: target name
# [1]: Runs FIPS build if '1'
# [2]: Uses nightly toolchain if '1'
# [3]: Verifies bindgen if '1'
target:
- [ aarch64-linux-android, 0, 0, 1]
- [ aarch64-unknown-linux-gnu, 1, 0, 1]
- [ aarch64-unknown-linux-musl, 1, 0, 1]
- [ arm-linux-androideabi, 0, 0, 0]
- [ arm-unknown-linux-gnueabihf, 0, 0, 1]
- [ arm-unknown-linux-musleabi, 1, 0, 1]
- [ arm-unknown-linux-musleabihf, 1, 0, 1]
- [ armv7-linux-androideabi, 0, 0, 1]
- [ armv7-unknown-linux-gnueabihf, 0, 0, 1]
- [ i686-unknown-linux-gnu, 0, 0, 1]
- [ mips-unknown-linux-gnu, 0, 1, 0]
- [ mips-unknown-linux-musl, 0, 1, 0]
- [ mips64-unknown-linux-muslabi64, 0, 1, 0]
- [ mips64el-unknown-linux-muslabi64, 0, 1, 0]
- [ powerpc-unknown-linux-gnu, 1, 0, 1]
- [ powerpc64-unknown-linux-gnu, 1, 0, 1]
- [ powerpc64le-unknown-linux-gnu, 1, 0, 1]
- [ riscv64gc-unknown-linux-gnu, 0, 0, 1]
- [ s390x-unknown-linux-gnu, 0, 0, 1]
- [ x86_64-pc-windows-gnu, 0, 0, 1] # Requires release build. See: https://github.com/rust-lang/rust/issues/139380
- [ x86_64-unknown-illumos, 0, 0, 1]
- [ x86_64-unknown-linux-musl, 0, 0, 1]
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "stable"
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: ${{ (matrix.target[2] == '0' && 'stable') || 'nightly' }}
target: ${{ (matrix.target[2] == '0' && matrix.target[0]) || '' }}
components: ${{ (matrix.target[2] == '0' && '') || 'rust-src' }}
- name: Set Rust toolchain override
run: rustup override set ${{ steps.toolchain.outputs.name }}
- if: ${{ !startsWith(matrix.target[0], 'x86_64') }}
run: |
echo 'AWS_LC_RS_DISABLE_SLOW_TESTS=1' >> "$GITHUB_ENV"
- if: ${{ matrix.target[0] == 'x86_64-unknown-illumos' }}
run: |
echo 'CROSS_TEST_EXTRA_FLAG=--no-run' >> "$GITHUB_ENV"
- if: ${{ matrix.target[0] != 'x86_64-unknown-illumos' }}
# Since Rust 1.89, doctests run by default.
# When cross-compiling, doctests do not have the environment setup properly to link to shared libraries.
# Per documentation:
# --all-targets Test all targets (does not include doctests)
run: |
echo 'CROSS_TEST_EXTRA_FLAG=--all-targets' >> "$GITHUB_ENV"
- name: Cross-compilation (test release)
run: cross test -p aws-lc-rs --release "${CROSS_TEST_EXTRA_FLAG}" --features unstable --target ${{ matrix.target[0] }}
- if: ${{ matrix.target[1] == '1' }}
name: Cross-compilation (test FIPS release)
run: cross test -p aws-lc-rs --release "${CROSS_TEST_EXTRA_FLAG}" --no-default-features --features fips --target ${{ matrix.target[0] }}
- name: Cross-compilation w/ internal bindgen (aws-lc-sys/ssl feature)
# There's a bug in the clang "atomic" header
# It was reported here: https://reviews.llvm.org/D75183
# It was finally fixed here: https://reviews.llvm.org/D118391
# Instead of trying to hack around this, we just won't test building libssl on that platform.
# We should update this test once cross-rs has an updated docker image for this target.
if: ${{ matrix.target[3] == '1' }}
run: |
cross test -p aws-lc-sys --release "${CROSS_TEST_EXTRA_FLAG}" --features ssl --target ${{ matrix.target[0] }}
- name: Install bindgen-cli
run: cargo install --locked bindgen-cli
- name: Cross-compilation w/ external bindgen (aws-lc-sys/ssl feature)
if: ${{ matrix.target[3] == '1' }}
env:
# require the use of external bindgen
AWS_LC_SYS_EXTERNAL_BINDGEN: 1
run:
cross test -p aws-lc-sys --release "${CROSS_TEST_EXTRA_FLAG}" --features bindgen --target ${{ matrix.target[0] }}
# This test ensures that older Android API levels (before getentropy was added in API 28)
# build correctly with the cc-builder. See: https://github.com/aws/aws-lc-rs/issues/1006
aws-lc-rs-android-old-api:
if: github.repository_owner == 'aws'
name: Android API ${{ matrix.api }} - ${{ matrix.target }} ${{ matrix.test_target_cc && '(TARGET_CC test)' || '' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
# API 21 is the oldest supported by current NDK (Android 5.0)
- target: aarch64-linux-android
api: 21
# API 24 is Android 7.0, still before getentropy (API 28)
- target: aarch64-linux-android
api: 24
- target: armv7-linux-androideabi
api: 21
- target: x86_64-linux-android
api: 21
- target: i686-linux-android
api: 21
# Add test case for TARGET_CC preference
- target: aarch64-linux-android
api: 21
test_target_cc: true
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Install Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26d
- name: Setup Android environment
run: |
# Convert target triple to NDK toolchain name
case "${{ matrix.target }}" in
aarch64-linux-android) TOOLCHAIN_TARGET="aarch64-linux-android" ;;
armv7-linux-androideabi) TOOLCHAIN_TARGET="armv7a-linux-androideabi" ;;
x86_64-linux-android) TOOLCHAIN_TARGET="x86_64-linux-android" ;;
i686-linux-android) TOOLCHAIN_TARGET="i686-linux-android" ;;
esac
NDK_BIN="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin"
# For the TARGET_CC test case, set both CC/CXX and TARGET_CC/CXX
if [ "${{ matrix.test_target_cc }}" = "true" ]; then
# Set regular CC/CXX to non-existent compiler to verify they're not used
echo "CC=${NDK_BIN}/non-existent-clang" >> $GITHUB_ENV
echo "CXX=${NDK_BIN}/non-existent-clang++" >> $GITHUB_ENV
# Set TARGET_CC/CXX to the correct compilers - these should be preferred
echo "TARGET_CC=${NDK_BIN}/${TOOLCHAIN_TARGET}${{ matrix.api }}-clang" >> $GITHUB_ENV
echo "TARGET_CXX=${NDK_BIN}/${TOOLCHAIN_TARGET}${{ matrix.api }}-clang++" >> $GITHUB_ENV
# Print for debugging
echo "Testing TARGET_CC/CXX preference:"
echo "CC=${CC}"
echo "TARGET_CC=${TARGET_CC}"
else
# Set compiler with API level (original behavior)
echo "CC_${{ matrix.target }}=${NDK_BIN}/${TOOLCHAIN_TARGET}${{ matrix.api }}-clang" >> $GITHUB_ENV
fi
echo "AR_${{ matrix.target }}=${NDK_BIN}/llvm-ar" >> $GITHUB_ENV
echo "RANLIB_${{ matrix.target }}=${NDK_BIN}/llvm-ranlib" >> $GITHUB_ENV
# Ensure we use cc-builder, not cmake
echo "AWS_LC_SYS_CMAKE_BUILDER=0" >> $GITHUB_ENV
- name: Build aws-lc-sys (cc-builder)
# Use --no-default-features to disable 'all-bindings' feature, which allows
# universal bindings to be used for targets without pre-generated bindings
run: cargo build -p aws-lc-sys --no-default-features --target ${{ matrix.target }}
- name: Build aws-lc-sys release (cc-builder)
run: cargo build -p aws-lc-sys --no-default-features --release --target ${{ matrix.target }}
aws-lc-rs-cross-prebuilt-nasm:
if: github.repository_owner == 'aws'
name: cross prebuilt-NASM - ${{ matrix.target[0] }}
runs-on: ubuntu-latest
env:
AWS_LC_SYS_PREBUILT_NASM: 1
strategy:
fail-fast: false
matrix:
target:
- [ x86_64-pc-windows-gnu, 0, 1 ]
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "stable"
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: "stable"
target: ${{ matrix.target[0] }}
- name: Set Rust toolchain override
run: rustup override set ${{ steps.toolchain.outputs.name }}
- if: ${{ !startsWith(matrix.target[0], 'x86_64') }}
run: |
echo 'AWS_LC_RS_DISABLE_SLOW_TESTS=1' >> "$GITHUB_ENV"
- name: Cross-compilation (test release)
run: CROSS_CONFIG=$(pwd)/Cross.toml.passthrough-only cross test -p aws-lc-rs --no-run --features unstable --target ${{ matrix.target[0] }}
aws-lc-rs-cross-0_2_5-test:
if: github.repository_owner == 'aws'
name: cross v0.2.5 tests ${{ matrix.target }}
runs-on: ubuntu-latest
env:
CROSS_CONFIG: "./Cross.toml.x86_64-unknown-linux-gnu"
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "stable"
- name: Install cross
run: cargo install cross --locked --version 0.2.5
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: "stable"
target: ${{ matrix.target }}
- name: Set Rust toolchain override
run: rustup override set ${{ steps.toolchain.outputs.name }}
- if: ${{ !startsWith(matrix.target[0], 'x86_64') }}
run: |
echo 'AWS_LC_RS_DISABLE_SLOW_TESTS=1' >> "$GITHUB_ENV"
- name: Cross-compilation (build debug)
run: cross build -p aws-lc-rs --features unstable --target ${{ matrix.target }}
- name: Cross-compilation (test release)
run: cross test -p aws-lc-rs --release --features unstable --target ${{ matrix.target }}
aws-lc-rs-ios-aarch64:
if: github.repository_owner == 'aws'
name: iOS aarch64 cross-platform build
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-go@v6
with:
go-version: '>=1.18'
- run: |
brew install llvm
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
target: aarch64-apple-ios-sim
- name: Install bash
run: brew install bash
- name: iOS Simulator Runner
run: ./scripts/ci/ios-simulator-runner.sh
aws-lc-rs-tvos-aarch64:
if: github.repository_owner == 'aws'
name: tvOS aarch64 cross-platform build
runs-on: macos-latest
env:
TVOS_FORCE_TEST: 1
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- run: |
brew install llvm
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Install bash, coreutils
run: brew install bash coreutils
- name: tvOS Simulator Runner
run: ./scripts/ci/tvos-simulator-runner.sh
aws-lc-rs-ios-x86_64:
if: github.repository_owner == 'aws'
name: iOS x86-64 cross-platform build
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- run: |
brew install llvm
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
target: x86_64-apple-ios
- name: Debug build for `x86_64-apple-ios`
run: cargo build -p aws-lc-rs --target x86_64-apple-ios --features bindgen
- name: Release build for `x86_64-apple-ios`
run: cargo build -p aws-lc-rs --release --target x86_64-apple-ios --features bindgen
cargo-xwin:
if: github.repository_owner == 'aws'
runs-on: ${{ matrix.host }}
strategy:
fail-fast: false
matrix:
host:
- ubuntu-latest
- macos-latest
- windows-latest
- windows-11-arm
target:
- "x86_64-pc-windows-msvc"
- "aarch64-pc-windows-msvc"
crt_static:
- "0"
- "1"
steps:
- name: Install build dependencies
if: matrix.host == 'ubuntu-latest'
# cargo-xwin apparently requires ninja-build
run: |
sudo apt-get update && sudo apt-get install --assume-yes nasm ninja-build llvm
- name: Install build dependencies
if: matrix.host == 'macos-latest'
run: |
brew install nasm ninja llvm
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Install cargo-xwin
run: cargo install --locked cargo-xwin
- name: Set RUSTFLAGS
if: contains(matrix.host, 'windows') != true
run: |
if [[ '${{ matrix.crt_static }}' == '1' ]]; then
echo "RUSTFLAGS=-Clink-arg=/WX -Ctarget-feature=+crt-static" >> $GITHUB_ENV
else
echo "RUSTFLAGS=-Clink-arg=/WX" >> $GITHUB_ENV
fi
echo "EXTRA_FLAGS=" >> $GITHUB_ENV
- name: Set RUSTFLAGS
if: contains(matrix.host, 'windows')
run: |
if ('${{ matrix.crt_static }}' -eq '1') {
echo "RUSTFLAGS=-Clink-arg=/WX -Ctarget-feature=+crt-static" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "RUSTFLAGS=-Clink-arg=/WX" | Out-File -FilePath $env:GITHUB_ENV -Append
}
if ('${{ matrix.host }}' -like '*arm*') {
echo "EXTRA_FLAGS=--features=prebuilt-nasm" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "EXTRA_FLAGS=" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: cargo xwin build for ${{ matrix.target }}
run: cargo xwin build -p aws-lc-rs --release --all-targets --target ${{ matrix.target }} ${{ env.EXTRA_FLAGS }}
- name: cargo test for x86_64-pc-windows-msvc
if: matrix.host == 'windows-latest' && matrix.target == 'x86_64-pc-windows-msvc'
env:
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER: 'cmd.exe'
run: cargo xwin test -p aws-lc-rs --release --all-targets --target x86_64-pc-windows-msvc ${{ env.EXTRA_FLAGS }}
- name: cargo test for aarch64-pc-windows-msvc
if: matrix.host == 'windows-11-arm' && matrix.target == 'aarch64-pc-windows-msvc'
env:
CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_RUNNER: 'cmd.exe'
run: cargo xwin test -p aws-lc-rs --release --all-targets --target aarch64-pc-windows-msvc ${{ env.EXTRA_FLAGS }}
aws-lc-rs-windows-msvc:
if: ${{ github.repository_owner == 'aws' }}
name: ${{ matrix.target }} ${{ (matrix.fips == '1' && '(FIPS)') || '' }} - ${{ (matrix.crt_static == '1' && 'crt-static and /WX') || '/WX' }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target:
- 'x86_64-pc-windows-msvc'
- 'i686-pc-windows-msvc'
- 'aarch64-pc-windows-msvc'
crt_static:
- '0'
- '1'
fips:
- '0'
- '1'
exclude:
- target: "i686-pc-windows-msvc"
fips: '1'
- target: "aarch64-pc-windows-msvc"
fips: '1'
steps:
- name: Install NASM
if: ${{ matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'i686-pc-windows-msvc' }}
uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Set ACTION_CARGO
run: |
if ('${{ matrix.target }}' -like '*aarch64*') {
echo "ACTION_CARGO=build" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "ACTION_CARGO=test" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: Set RUSTFLAGS
run: |
if ('${{ matrix.crt_static }}' -eq '1') {
echo "RUSTFLAGS=-Clink-arg=/WX -Ctarget-feature=+crt-static" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "RUSTFLAGS=-Clink-arg=/WX" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: Debug build
run: cargo ${{ env.ACTION_CARGO }} -p aws-lc-rs --all-targets --target ${{ matrix.target }} --features bindgen${{ (matrix.fips == '1' && ',fips') || '' }}
- name: Release Build for ${{ matrix.target }}
run: cargo ${{ env.ACTION_CARGO }} --release -p aws-lc-rs --all-targets --target ${{ matrix.target }}${{ (matrix.fips == '1' && ' --features fips') || '' }}
freebsd:
if: github.repository_owner == 'aws'
name: freebsd ${{ matrix.release }} (${{ matrix.arch }}) -- ${{ matrix.options }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [ 'x86_64' ] # , 'aarch64', 'riscv64' ]
release: [ '14.3', '15.0' ]
options:
- '--all-targets'
- '--release'
- '--no-default-features --features=fips'
# exclude:
# - arch: 'riscv64'
# options: '--no-default-features --features=fips'
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Prepare VM
uses: vmactions/freebsd-vm@v1
with:
release: ${{ matrix.release }}
arch: ${{ matrix.arch }}
usesh: true
copyback: false
prepare: |
pkg install -y git gmake bash sudo cmake-core llvm-devel-lite curl go ca_root_nss
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
cargo test -p aws-lc-rs ${{ matrix.options }}
netbsd:
if: github.repository_owner == 'aws'
name: netbsd ${{ matrix.release }} (${{ matrix.arch }}) -- ${{ matrix.options }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [ 'x86_64' ] # , 'aarch64' ]
release: [ '10.1' ]
options:
- '--all-targets'
- '--release'
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Prepare VM
uses: vmactions/netbsd-vm@v1
with:
release: ${{ matrix.release }}
arch: ${{ matrix.arch }}
usesh: true
copyback: false
prepare: |
export PATH="/usr/pkg/bin:/usr/pkg/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
export PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/${{ matrix.arch }}/${{ matrix.release }}/All"
pkg_add -u curl cmake gmake perl mozilla-rootcerts
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
cargo test -p aws-lc-rs ${{ matrix.options }}
cross-x86_64-pc-windows-gnu:
if: github.repository_owner == 'aws'
name: cross (prebuilt nasm) - x86_64-pc-windows-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@stable
id: toolchain
with:
toolchain: "stable"
target: x86_64-pc-windows-gnu
- name: Install mingw
run: sudo apt-get update && sudo apt-get install --assume-yes mingw-w64
- name: Run cargo test
run: cargo build -p aws-lc-rs --features prebuilt-nasm --target x86_64-pc-windows-gnu
open-harmony:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Build Docker Image
working-directory: .github/docker_images/ohos-5.0.0
run: |
./build_image.sh
- name: Build
run: |
docker run -v "${{ github.workspace }}:/aws_lc_rs" ohos:5.0.0
alpine-linux:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Build Docker Image
working-directory: .github/docker_images/alpine-3.20
run: |
./build_image.sh
- name: Build
run: |
docker run -v "${{ github.workspace }}:/aws_lc_rs" alpine:3.20
openwrt-sdk:
# Test for OpenWrt cross-compilation environment
# Verifies fix for https://github.com/aws/aws-lc-rs/issues/1009
# OpenWrt sets CC to host compiler and TARGET_CC to cross compiler
if: github.repository_owner == 'aws'
name: OpenWrt SDK (aarch64-musl)
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Build Docker Image
working-directory: .github/docker_images/openwrt-24.10
run: |
./build_image.sh
- name: Build
run: |
docker run -v "${{ github.workspace }}:/aws_lc_rs" openwrt:24.10
msys2:
name: msys2 ${{ matrix.sys }} - ${{ matrix.nasm }}, ${{ matrix.generator }}
if: github.repository_owner == 'aws'
runs-on: windows-latest
env:
AWS_LC_SYS_EXTERNAL_BINDGEN: 1
strategy:
fail-fast: false
matrix:
sys:
- mingw64
- ucrt64
- clang64
nasm:
- 'prebuilt'
- 'nasm'
generator:
- ninja
- msys
- mingw
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
id: setup_msys2
with:
msystem: ${{ matrix.sys }}
update: true
pacboy: >-
cmake
toolchain
llvm
rust
rust-bindgen
ninja
cc
go
${{ (matrix.nasm == 'nasm' && 'nasm') || 'make' }}
- name: Update Environment
shell: bash
run: |
SYSROOT=$(cygpath -a -m '${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}')
echo "AWS_LC_SYS_PREBUILT_NASM=${{ (matrix.nasm == 'nasm' && '0') || '1' }}" >> $GITHUB_ENV
echo "BINDGEN_EXTRA_CLANG_ARGS=-target x86_64-pc-windows-gnu" >> $GITHUB_ENV
echo "GOPATH=${SYSROOT}" >> $GITHUB_ENV
echo "GOROOT=${SYSROOT}/lib/go" >> $GITHUB_ENV
cygpath -w ${SYSROOT}/bin >> $GITHUB_PATH
- name: Set CMAKE_GENERATOR
if: matrix.generator == 'ninja'
shell: bash
run: |
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Set LIBCLANG_PATH
if: matrix.generator == 'msys'
shell: bash
run: |
SYSROOT=$(cygpath -a -m '${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}')
echo "LIBCLANG_PATH=${SYSROOT}/lib" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Test
shell: msys2 {0}
run: cargo test --verbose --features bindgen --release -p aws-lc-rs
msys2-no-cmake:
name: msys2-no-cmake ${{ matrix.sys }} - ${{ matrix.nasm }}
if: github.repository_owner == 'aws'
runs-on: windows-latest
env:
AWS_LC_SYS_CMAKE_BUILDER: 0
strategy:
fail-fast: false
matrix:
sys:
- mingw64
- ucrt64
- clang64
nasm:
- 'prebuilt'
- 'nasm'
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
id: setup_msys2
with:
msystem: ${{ matrix.sys }}
update: true
pacboy: >-
toolchain
rust
rust-bindgen
cc
${{ (matrix.nasm == 'nasm' && 'nasm') || 'make' }}
- name: Update Environment
shell: bash
run: |
SYSROOT=$(cygpath -a -m '${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}')
echo "AWS_LC_SYS_PREBUILT_NASM=${{ (matrix.nasm == 'nasm' && '0') || '1' }}" >> $GITHUB_ENV
echo "GOPATH=${SYSROOT}" >> $GITHUB_ENV
echo "GOROOT=${SYSROOT}/lib/go" >> $GITHUB_ENV
cygpath -w ${SYSROOT}/bin >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Test
shell: msys2 {0}
run: cargo test --verbose --release -p aws-lc-rs
musl-tests:
name: musl - ${{ matrix.config.arch }}
env:
CC: musl-gcc
strategy:
fail-fast: false
matrix:
config:
- { host: 'ubuntu-latest', arch: 'x86_64' }
- { host: 'ubuntu-24.04-arm', arch: 'aarch64' }
runs-on: ${{ matrix.config.host }}
container:
image: rust:latest
options: "--platform linux/${{ (matrix.config.arch == 'aarch64' && 'arm64/v8') || 'amd64'}}"
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- run: |
set -x
apt-get update
apt-get install -y musl-tools musl-dev
- name: Build
run: cargo build --verbose --release -p aws-lc-rs
- name: Test
run: cargo test --verbose -p aws-lc-rs