|
| 1 | +name: libfido2 Tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [ 'master', 'main', 'release/**' ] |
| 5 | + pull_request: |
| 6 | + branches: [ '*' ] |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | +jobs: |
| 11 | + build_wolfprovider: |
| 12 | + uses: ./.github/workflows/build-wolfprovider.yml |
| 13 | + with: |
| 14 | + wolfssl_ref: ${{ matrix.wolfssl_ref }} |
| 15 | + openssl_ref: ${{ matrix.openssl_ref }} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 19 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 20 | + test_libfido2: |
| 21 | + runs-on: ubuntu-22.04 |
| 22 | + needs: build_wolfprovider |
| 23 | + timeout-minutes: 15 |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 27 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 28 | + libfido2_ref: [ 'main', '1.15.0' ] |
| 29 | + force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ] |
| 30 | + exclude: |
| 31 | + - libfido2_ref: 'main' |
| 32 | + force_fail: 'WOLFPROV_FORCE_FAIL=1' |
| 33 | + steps: |
| 34 | + - name: Checkout wolfProvider |
| 35 | + uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + fetch-depth: 1 |
| 38 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 39 | + uses: actions/cache/restore@v4 |
| 40 | + id: wolfprov-cache |
| 41 | + with: |
| 42 | + path: | |
| 43 | + scripts |
| 44 | + wolfssl-source |
| 45 | + wolfssl-install |
| 46 | + wolfprov-install |
| 47 | + openssl-install |
| 48 | + provider.conf |
| 49 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }} |
| 50 | + fail-on-cache-miss: true |
| 51 | + - name: Install test dependencies |
| 52 | + run: | |
| 53 | + sudo apt-get update |
| 54 | + sudo apt-get install -y build-essential cmake pkg-config libssl-dev libudev-dev zlib1g-dev libcbor-dev libpcsclite-dev pcscd |
| 55 | + - name: Checkout libfido2 |
| 56 | + uses: actions/checkout@v4 |
| 57 | + with: |
| 58 | + repository: Yubico/libfido2 |
| 59 | + path: libfido2_repo |
| 60 | + ref: ${{ matrix.libfido2_ref }} |
| 61 | + fetch-depth: 1 |
| 62 | + - name: Build and install libfido2 |
| 63 | + working-directory: libfido2_repo |
| 64 | + run: | |
| 65 | + mkdir build |
| 66 | + cd build |
| 67 | + cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/libfido2-install .. |
| 68 | + make -j$(nproc) |
| 69 | + make install |
| 70 | + - name: Run libfido2 tests |
| 71 | + working-directory: libfido2_repo/build |
| 72 | + run: | |
| 73 | + # Set up the environment for wolfProvider |
| 74 | + source $GITHUB_WORKSPACE/scripts/env-setup |
| 75 | + export ${{ matrix.force_fail }} |
| 76 | +
|
| 77 | + # Run tests, excluding regress_dev which requires hardware/fails in CI |
| 78 | + ctest --exclude-regex "regress_dev" 2>&1 | tee libfido2-test.log |
| 79 | +
|
| 80 | + # Check test results directly in YAML |
| 81 | + if grep -q "100% tests passed" libfido2-test.log; then |
| 82 | + TEST_RESULT=0 |
| 83 | + else |
| 84 | + TEST_RESULT=1 |
| 85 | + fi |
| 86 | +
|
| 87 | + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} libfido2 |
| 88 | +
|
| 89 | +
|
| 90 | +
|
0 commit comments