Skip to content

Commit

Permalink
Hoist functional tests into composite action
Browse files Browse the repository at this point in the history
Signed-off-by: Hanno Becker <[email protected]>
  • Loading branch information
hanno-becker committed Sep 10, 2024
1 parent 6ec233c commit 227fd53
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 18 deletions.
37 changes: 37 additions & 0 deletions .github/actions/functest/action.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 4 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 227fd53

Please sign in to comment.