Skip to content

Commit 64777d9

Browse files
committed
Add AWS-LC to GitHub Actions
1 parent 6c1830e commit 64777d9

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ jobs:
151151
- true
152152
- false
153153
library:
154+
- name: aws-lc
155+
version: v1.48.2
156+
- name: aws-lc
157+
version: vendored
154158
- name: boringssl
155159
version: e23fe9b6eecc10e4f9ea1f0027fea5eaee7bd6b6
156160
- name: openssl
@@ -276,18 +280,25 @@ jobs:
276280
url="https://boringssl.googlesource.com/boringssl/+archive/${{ matrix.library.version }}.tar.gz"
277281
tar_flags=""
278282
;;
283+
"aws-lc")
284+
url="https://github.com/aws/aws-lc/archive/refs/tags/${{ matrix.library.version }}.tar.gz"
285+
tar_flags="--strip-components=1"
286+
;;
279287
esac
280288
281289
case "${{ matrix.target}}" in
282290
"x86_64-unknown-linux-gnu")
291+
CPU=x86_64
283292
OS_COMPILER=linux-x86_64
284293
OS_FLAGS=""
285294
;;
286295
"i686-unknown-linux-gnu")
296+
CPU=i686
287297
OS_COMPILER=linux-elf
288298
OS_FLAGS="-m32 -msse2"
289299
;;
290300
"arm-unknown-linux-gnueabihf")
301+
CPU=armv4
291302
OS_COMPILER=linux-armv4
292303
OS_FLAGS=""
293304
export AR=arm-linux-gnueabihf-ar
@@ -317,7 +328,7 @@ jobs:
317328
cd build
318329
319330
echo "set(CMAKE_SYSTEM_NAME Linux)" > toolchain.cmake
320-
echo "set(CMAKE_SYSTEM_PROCESSOR $cpu)" >> toolchain.cmake
331+
echo "set(CMAKE_SYSTEM_PROCESSOR $CPU)" >> toolchain.cmake
321332
echo "set(triple ${{ matrix.target }})" >> toolchain.cmake
322333
echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} '$OS_FLAGS '" CACHE STRING "c++ flags")' >> toolchain.cmake
323334
echo 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} '$OS_FLAGS '" CACHE STRING "c flags")' >> toolchain.cmake
@@ -330,6 +341,22 @@ jobs:
330341
# Copy stuff around so it's all as the build system expects.
331342
cp -r ../rust/ "$OPENSSL_DIR/rust"
332343
cp -r ./ "$OPENSSL_DIR/build"
344+
;;
345+
"aws-lc")
346+
mkdir build
347+
cd build
348+
349+
echo "set(CMAKE_SYSTEM_NAME Linux)" > toolchain.cmake
350+
echo "set(CMAKE_SYSTEM_PROCESSOR $CPU)" >> toolchain.cmake
351+
echo "set(triple ${{ matrix.target }})" >> toolchain.cmake
352+
echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} '$OS_FLAGS '" CACHE STRING "c++ flags")' >> toolchain.cmake
353+
echo 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} '$OS_FLAGS '" CACHE STRING "c flags")' >> toolchain.cmake
354+
echo 'set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} '$OS_FLAGS '" CACHE STRING "asm flags")' >> toolchain.cmake
355+
356+
cmake .. -DCMAKE_INSTALL_PREFIX="${OPENSSL_DIR}" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake
357+
make -j "$(nproc)"
358+
make install
359+
;;
333360
esac
334361
335362
if: matrix.library.version != 'vendored' && !steps.openssl-cache.outputs.cache-hit
@@ -359,19 +386,23 @@ jobs:
359386
if [[ "${{ matrix.library.version }}" == "vendored" ]]; then
360387
features="--features vendored"
361388
fi
362-
if [[ "${{ matrix.bindgen }}" == "true" && "${{ matrix.library.name }}" != "boringssl" ]]; then
389+
if [[ "${{ matrix.bindgen }}" == "true" ]]; then
363390
features="$features --features bindgen"
364391
fi
365392
cargo run --manifest-path=systest/Cargo.toml --target ${{ matrix.target }} $features
366-
if: matrix.library.name != 'boringssl'
393+
if: ${{ !(matrix.library.name == 'boringssl' || matrix.library.name == 'aws-lc') }}
367394
- name: Test openssl
368395
run: |
369396
if [[ "${{ matrix.library.name }}" == "boringssl" && "${{ matrix.bindgen }}" != "true" ]]; then
370397
features="--features unstable_boringssl"
371398
BORINGSSL_BUILD_DIR="$OPENSSL_DIR/build/"
372399
fi
373400
if [[ "${{ matrix.library.version }}" == "vendored" ]]; then
374-
features="--features vendored"
401+
if [[ "${{ matrix.library.name }}" == "aws-lc" ]]; then
402+
features="--features aws-lc"
403+
else
404+
features="--features vendored"
405+
fi
375406
fi
376407
if [[ "${{ matrix.bindgen }}" == "true" ]]; then
377408
features="$features --features bindgen"
@@ -386,4 +417,4 @@ jobs:
386417
features="$features --features openssl-sys/bindgen"
387418
fi
388419
cargo test --manifest-path=openssl-errors/Cargo.toml --target ${{ matrix.target }} $features
389-
if: matrix.library.name != 'boringssl'
420+
if: ${{ !(matrix.library.name == 'boringssl' || matrix.library.name == 'aws-lc') }}

openssl-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rust-version = "1.63.0"
1818
[features]
1919
vendored = ['openssl-src']
2020
unstable_boringssl = ['bssl-sys']
21-
aws-lc = ['aws-lc-sys']
21+
aws-lc = ['dep:aws-lc-sys']
2222

2323
[dependencies]
2424
libc = "0.2"

0 commit comments

Comments
 (0)