From 227fd53fe67b8fc05aa4c54ec5b20ef76b02f861 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 10 Sep 2024 16:28:49 +0100 Subject: [PATCH] Hoist functional tests into composite action Signed-off-by: Hanno Becker --- .github/actions/functest/action.yml | 37 +++++++++++++++++++++++++++++ .github/workflows/ci.yml | 22 ++++------------- 2 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 .github/actions/functest/action.yml diff --git a/.github/actions/functest/action.yml b/.github/actions/functest/action.yml new file mode 100644 index 000000000..7e8fb1da6 --- /dev/null +++ b/.github/actions/functest/action.yml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 + +name: Functional tests +description: Run functional tests for MLKEM-C_AArch64 + +inputs: + cflags: + description: CFLAGS to pass to compilation + default: '' + cross-prefix: + description: Binary prefix for cross compilation + default: '' +runs: + using: composite + steps: + - name: Run functional tests + id: func_test + shell: nix develop .#ci -c bash -e {0} + run: | + tests func --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v + - name: Run KAT tests + if: | + success() + || steps.func_test.conclusion == 'failure' + id: kat_test + shell: nix develop .#ci -c bash -e {0} + run: | + tests kat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v + - name: Run Nistkat tests + id: nistkat_test + if: | + success() + || steps.func_test.conclusion == 'failure' + || steps.kat_test.conclusion == 'failure' + shell: nix develop .#ci -c bash -e {0} + run: | + tests nistkat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c33d9597..2fb9cc000 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,24 +62,10 @@ jobs: exit 1 fi - name: Run functional tests - id: func_test - run: | - tests func --cross-prefix=${{ matrix.target.cross-prefix }} --cflags ${{ matrix.target.cflags }} -v - - name: Run KAT tests - id: kat_test - if: | - success() - || steps.func_test.conclusion == 'failure' - run: | - tests kat --cross-prefix=${{ matrix.target.cross-prefix }} --cflags ${{ matrix.target.cflags }} -v - - name: Run Nistkat tests - id: nistkat_test - if: | - success() - || steps.func_test.conclusion == 'failure' - || steps.kat_test.conclusion == 'failure' - run: | - tests nistkat --cross-prefix=${{ matrix.target.cross-prefix }} --cflags ${{ matrix.target.cflags }} -v + uses: ./.github/actions/functest + with: + cflags: ${{ matrix.target.cflags }} + cross-prefix: ${{ matrix.target.cross-prefix }} lint: strategy: matrix: