-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6252 from julek-wolfssl/async-test-action
Initial async test with gh action
- Loading branch information
Showing
3 changed files
with
105 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Async Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
make_check: | ||
strategy: | ||
matrix: | ||
config: [ | ||
# Add new configs here | ||
'--enable-asynccrypt --enable-all --enable-dtls13', | ||
] | ||
name: make check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checkout wolfSSL | ||
|
||
- name: Test wolfSSL async | ||
run: | | ||
./async-check.sh setup | ||
./configure ${{ matrix.config }} | ||
make check | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,62 +5,30 @@ | |
# This script creates symbolic links to the required asynchronous | ||
# file for using the asynchronous simulator and make check | ||
# | ||
# $ ./async-check [keep] | ||
# $ ./async-check [keep|clean|setup] | ||
# | ||
# - keep: (default off) ./async and links kept around for inspection | ||
# - clean: (default off) only cleanup existing ./async and links | ||
# - setup: (default off) only setup ./async and links but don't run config | ||
# or make | ||
# | ||
|
||
ASYNC_REPO=https://github.com/wolfSSL/wolfAsyncCrypt.git | ||
|
||
function Usage() { | ||
printf '\n%s\n' "Usage: $0 [keep]" | ||
printf '\n%s\n\n' "Where \"keep\" means keep (default off) async files around for inspection" | ||
printf '\n%s\n\n' "Usage: $0 [keep|clean|setup]" | ||
printf '%s\n' "Where \"keep\" means keep (default off) async files around for inspection" | ||
printf '%s\n' "Where \"clean\" means only clean (default off) the async files" | ||
printf '%s\n\n' "Where \"setup\" means only setup (default off) the async files" | ||
printf '%s\n' "EXAMPLE:" | ||
printf '%s\n' "---------------------------------" | ||
printf '%s\n' "./async-check.sh keep" | ||
printf '%s\n' "./async-check.sh clean" | ||
printf '%s\n' "./async-check.sh setup" | ||
printf '%s\n\n' "---------------------------------" | ||
} | ||
|
||
[email protected]:wolfSSL/wolfAsyncCrypt.git | ||
#ASYNC_REPO=../wolfAsyncCrypt | ||
|
||
# Optionally keep async files | ||
if [ "x$1" == "xkeep" ]; then KEEP="yes"; else KEEP="no"; fi | ||
|
||
|
||
if [ -d ./async ]; | ||
then | ||
echo "\n\nUsing existing async repo\n\n" | ||
else | ||
# make a clone of the wolfAsyncCrypt repository | ||
git clone --depth 1 $ASYNC_REPO async | ||
[ $? -ne 0 ] && echo "\n\nCouldn't checkout the wolfAsyncCrypt repository\n\n" && exit 1 | ||
fi | ||
|
||
# setup auto-conf | ||
./autogen.sh | ||
|
||
|
||
# link files | ||
ln -s -F ../../async/wolfcrypt/src/async.c ./wolfcrypt/src/async.c | ||
ln -s -F ../../async/wolfssl/wolfcrypt/async.h ./wolfssl/wolfcrypt/async.h | ||
ln -s -F ../../../../async/wolfcrypt/src/port/intel/quickassist.c ./wolfcrypt/src/port/intel/quickassist.c | ||
ln -s -F ../../../../async/wolfcrypt/src/port/intel/quickassist_mem.c ./wolfcrypt/src/port/intel/quickassist_mem.c | ||
ln -s -F ../../../../async/wolfcrypt/src/port/intel/README.md ./wolfcrypt/src/port/intel/README.md | ||
ln -s -F ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist.h ./wolfssl/wolfcrypt/port/intel/quickassist.h | ||
ln -s -F ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist_mem.h ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h | ||
ln -s -F ../../../../async/wolfcrypt/src/port/cavium/cavium_nitrox.c ./wolfcrypt/src/port/cavium/cavium_nitrox.c | ||
ln -s -F ../../../../async/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h | ||
ln -s -F ../../../../async/wolfcrypt/src/port/cavium/README.md ./wolfcrypt/src/port/cavium/README.md | ||
|
||
|
||
./configure --enable-asynccrypt --enable-all | ||
make check | ||
[ $? -ne 0 ] && echo "\n\nMake check failed. Debris left for analysis." && exit 1 | ||
|
||
|
||
# Clean up | ||
popd | ||
if [ "x$KEEP" == "xno" ]; | ||
then | ||
function CleanUp() { | ||
unlink ./wolfcrypt/src/async.c | ||
unlink ./wolfssl/wolfcrypt/async.h | ||
unlink ./wolfcrypt/src/port/intel/quickassist.c | ||
|
@@ -77,4 +45,69 @@ then | |
# restore original README.md files | ||
git checkout -- wolfcrypt/src/port/cavium/README.md | ||
git checkout -- wolfcrypt/src/port/intel/README.md | ||
} | ||
|
||
function LinkFiles() { | ||
# link files | ||
ln -s -f ../../async/wolfcrypt/src/async.c ./wolfcrypt/src/async.c | ||
ln -s -f ../../async/wolfssl/wolfcrypt/async.h ./wolfssl/wolfcrypt/async.h | ||
ln -s -f ../../../../async/wolfcrypt/src/port/intel/quickassist.c ./wolfcrypt/src/port/intel/quickassist.c | ||
ln -s -f ../../../../async/wolfcrypt/src/port/intel/quickassist_mem.c ./wolfcrypt/src/port/intel/quickassist_mem.c | ||
ln -s -f ../../../../async/wolfcrypt/src/port/intel/README.md ./wolfcrypt/src/port/intel/README.md | ||
ln -s -f ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist.h ./wolfssl/wolfcrypt/port/intel/quickassist.h | ||
ln -s -f ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist_mem.h ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h | ||
ln -s -f ../../../../async/wolfcrypt/src/port/cavium/cavium_nitrox.c ./wolfcrypt/src/port/cavium/cavium_nitrox.c | ||
ln -s -f ../../../../async/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h | ||
ln -s -f ../../../../async/wolfcrypt/src/port/cavium/README.md ./wolfcrypt/src/port/cavium/README.md | ||
} | ||
|
||
if [ "$#" -gt 1 ]; then | ||
Usage | ||
exit 1 | ||
fi | ||
|
||
KEEP=no | ||
ONLY_SETUP=no | ||
|
||
case "x$1" in | ||
"xkeep") | ||
KEEP=yes | ||
;; | ||
"xclean") | ||
CleanUp | ||
exit 0 | ||
;; | ||
"xsetup") | ||
ONLY_SETUP=yes | ||
;; | ||
*) | ||
Usage | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Fail on any error in script from now on | ||
set -e | ||
|
||
if [ -d ./async ]; | ||
then | ||
echo "\n\nUsing existing async repo\n\n" | ||
else | ||
# make a clone of the wolfAsyncCrypt repository | ||
git clone --depth 1 $ASYNC_REPO async | ||
fi | ||
|
||
# setup auto-conf | ||
./autogen.sh | ||
LinkFiles | ||
if [ "x$ONLY_SETUP" == "xno" ]; | ||
then | ||
./configure --enable-asynccrypt --enable-all | ||
make check | ||
# Clean up | ||
if [ "x$KEEP" == "xno" ]; | ||
then | ||
CleanUp | ||
fi | ||
fi | ||
|