|
| 1 | +name: libssh2 Tests |
| 2 | + |
| 3 | +# START OF COMMON SECTION |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ 'master', 'main', 'release/**' ] |
| 7 | + pull_request: |
| 8 | + branches: [ '*' ] |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | +# END OF COMMON SECTION |
| 14 | + |
| 15 | +jobs: |
| 16 | + build_wolfprovider: |
| 17 | + uses: ./.github/workflows/build-wolfprovider.yml |
| 18 | + with: |
| 19 | + wolfssl_ref: ${{ matrix.wolfssl_ref }} |
| 20 | + openssl_ref: ${{ matrix.openssl_ref }} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 24 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 25 | + |
| 26 | + test_libssh2: |
| 27 | + runs-on: ubuntu-22.04 |
| 28 | + needs: build_wolfprovider |
| 29 | + timeout-minutes: 20 |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + libssh2_ref: [ 'libssh2-1.10.0' ] |
| 33 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 34 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 35 | + force_fail: ['WOLFPROV_FORCE_FAIL=1', ''] |
| 36 | + steps: |
| 37 | + - name: Checkout wolfProvider |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + fetch-depth: 1 |
| 41 | + |
| 42 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 43 | + uses: actions/cache/restore@v4 |
| 44 | + id: wolfprov-cache |
| 45 | + with: |
| 46 | + path: | |
| 47 | + wolfssl-install |
| 48 | + wolfprov-install |
| 49 | + openssl-install/lib64 |
| 50 | + openssl-install/include |
| 51 | + openssl-install/bin |
| 52 | +
|
| 53 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }} |
| 54 | + fail-on-cache-miss: true |
| 55 | + |
| 56 | + - name: Install dependencies |
| 57 | + run: | |
| 58 | + sudo apt-get update |
| 59 | + sudo apt-get install -y build-essential autoconf libtool pkg-config clang libc++-dev python3-impacket |
| 60 | +
|
| 61 | + - name: Checkout OSP |
| 62 | + uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + repository: wolfssl/osp |
| 65 | + path: osp |
| 66 | + fetch-depth: 1 |
| 67 | + |
| 68 | + - name: Clone libssh2 |
| 69 | + run: | |
| 70 | + git clone --depth=1 --branch ${{ matrix.libssh2_ref }} https://github.com/libssh2/libssh2.git libssh2 |
| 71 | +
|
| 72 | + - name: Apply patch |
| 73 | + working-directory: libssh2 |
| 74 | + run: | |
| 75 | + patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/libssh2/${{ matrix.libssh2_ref }}-wolfprov.patch |
| 76 | +
|
| 77 | + - name: Build libssh2 |
| 78 | + working-directory: libssh2 |
| 79 | + run: | |
| 80 | + autoreconf -fi |
| 81 | + ./configure --with-crypto=openssl --with-libssl-prefix="$GITHUB_WORKSPACE/openssl-install" |
| 82 | + make -j$(nproc) |
| 83 | +
|
| 84 | + - name: Run libssh2 tests |
| 85 | + working-directory: libssh2 |
| 86 | + run: | |
| 87 | + # Set up the environment for wolfProvider |
| 88 | + source $GITHUB_WORKSPACE/scripts/env-setup |
| 89 | + export ${{ matrix.force_fail }} |
| 90 | +
|
| 91 | + # Run the tests and capture the result |
| 92 | + make check 2>&1 | tee libssh2-test.log |
| 93 | + TEST_RESULT=$(grep -q "FAIL: ssh2.sh" libssh2-test.log && echo "1" || echo "0") |
| 94 | + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} libssh2 |
0 commit comments