@@ -3,8 +3,7 @@ name: Simple Tests
33# START OF COMMON SECTION
44on :
55 push :
6- branches : [ '*' ]
7- # branches: [ 'master', 'main', 'release/**' ]
6+ branches : [ 'master', 'main', 'release/**' ]
87 pull_request :
98 branches : [ '*' ]
109
@@ -14,53 +13,65 @@ concurrency:
1413# END OF COMMON SECTION
1514
1615jobs :
17- make_check :
18- runs-on : ubuntu-latest
16+ simple_test :
17+ name : Simple Test
18+ runs-on : ubuntu-22.04
1919 timeout-minutes : 20
20-
2120 strategy :
2221 matrix :
23- config :
22+ build_ref :
2423 - ' '
2524 - ' OPENSSL_TAG=master'
2625 - ' WOLFSSL_TAG=master'
2726 - ' OPENSSL_TAG=master WOLFSSL_TAG=master'
28- force_fail :
29- - ' '
30- - ' WOLFPROV_FORCE_FAIL=1'
27+ force_fail : [ 1, 0 ] # ['WOLFPROV_FORCE_FAIL=1', '']
3128
3229 steps :
33- - uses : actions/checkout@v4
34- name : Checkout repository
30+ - name : Checkout wolfProvider
31+ uses : actions/checkout@v4
3532
36- - name : Run build and tests
37- run : |
38- # Build first with matrix config
39- ${{ matrix.config }} ${{ matrix.force_fail }} ./scripts/build-wolfprovider.sh || BUILD_RESULT=$?
33+ # Check if this version of wolfssl/wolfprovider has already been built,
34+ # mark to cache these items on post if we do end up building
35+ - name : Checking wolfSSL/wolfProvider in cache
36+ uses : actions/cache@v4
37+ id : wolfprov-cache
38+ with :
39+ path : |
40+ wolfssl-source
41+ wolfssl-install
42+ wolfprov-install
43+ provider.conf
4044
41- # Run all tests regardless of build result
42- ${{ matrix.force_fail }} ./scripts/cmd_test/do-cmd-tests.sh || TEST_RESULT=$?
45+ key : wolfprov-${{ matrix.build_ref }}-${{ github.sha }}
46+ lookup-only : true
4347
44- # For force_fail, we expect failures (return 1)
45- if [ -n "${{ matrix.force_fail }}" ]; then
46- if [ $BUILD_RESULT -eq 0 ] || [ $TEST_RESULT -eq 0 ]; then
47- echo "Build/Test unexpectedly succeeded with force fail enabled"
48- exit 1 # failure was not seen when expected
49- else
50- echo "Build/Test failed as expected with force fail enabled"
51- exit 0 # expected failure occurred
52- fi
53- else
54- # Normal case - expect success
55- if [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
56- exit 1 # unexpected failure
57- fi
58- fi
48+ # If wolfssl/wolfprovider have not yet been built, pull ossl from cache
49+ - name : Checking OpenSSL in cache
50+ if : steps.wolfprov-${{ matrix.build_ref }}-cache.hit != 'true'
51+ uses : actions/cache@v4
52+ id : openssl-cache
53+ with :
54+ path : |
55+ openssl-source
56+ openssl-install
57+
58+ key : ossl-depends
59+
60+ # If not yet built this version, build it now
61+ - name : Build wolfProvider
62+ if : steps.wolfprov-${{ matrix.build_ref }}-cache.hit != 'true'
63+ run : |
64+ ${{ matrix.build_ref.openssl }} ${{ matrix.build_ref.wolfssl }} WOLFPROV_FORCE_FAIL=${{ matrix.force_fail }} ./scripts/build-wolfprovider.sh || BUILD_RESULT=$?
65+ $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $BUILD_RESULT ${{ matrix.force_fail }} simple
66+
67+ - name : Run simple tests
68+ run : |
69+ WOLFPROV_FORCE_FAIL=${{ matrix.force_fail }} ./scripts/cmd_test/do-cmd-tests.sh || TEST_RESULT=$?
70+ $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} simple
5971
6072 - name : Print test logs
6173 if : always()
6274 run : |
6375 if [ -f test-suite.log ] ; then
6476 cat test-suite.log
6577 fi
66-
0 commit comments