Skip to content

Commit

Permalink
CI: integrate acvp into tests all
Browse files Browse the repository at this point in the history
Signed-off-by: Thing-han, Lim <[email protected]>
  • Loading branch information
potsrevennil committed Nov 12, 2024
1 parent 3c0318c commit ba99fb9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .github/actions/functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ inputs:
nistkat:
description: Determine whether to run nistkat test or not
default: "true"
acvp:
description: Determine whether to run acvp test or not
default: "true"
runs:
using: composite
steps:
Expand All @@ -55,6 +58,7 @@ runs:
echo FUNC="${{ inputs.func == 'true' && 'func' || 'no-func' }}" >> $GITHUB_ENV
echo KAT="${{ inputs.kat == 'true' && 'kat' || 'no-kat' }}" >> $GITHUB_ENV
echo NISTKAT="${{ inputs.nistkat == 'true' && 'nistkat' || 'no-nistkat' }}" >> $GITHUB_ENV
echo ACVP="${{ inputs.acvp == 'true' && 'acvp' || 'no-acvp' }}" >> $GITHUB_ENV
- name: Setup nix
uses: ./.github/actions/setup-shell
with:
Expand Down Expand Up @@ -86,7 +90,7 @@ runs:
- name: ${{ inputs.mode }} ${{ inputs.opt }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
shell: ${{ env.SHELL }}
run: |
tests all --cross-prefix="${{ env._CROSS_PREFIX }}" --cflags="${{ inputs.cflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.NISTKAT }} -v
tests all --cross-prefix="${{ env._CROSS_PREFIX }}" --cflags="${{ inputs.cflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.NISTKAT }} --${{ env.ACVP }} -v
- name: Check namespacing ${{ inputs.mode }} ${{ inputs.opt }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
shell: ${{ env.SHELL }}
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/multi-functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ inputs:
nistkat:
description: Determine whether to run nistkat test or not
default: "true"
acvp:
description: Determine whether to run acvp test or not
default: "true"
runs:
using: composite
steps:
Expand All @@ -55,6 +58,7 @@ runs:
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
nistkat: ${{ inputs.nistkat }}
acvp: ${{ inputs.acvp }}
- name: Cross Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross') && (success() || failure()) }}
uses: ./.github/actions/functest
Expand All @@ -70,3 +74,4 @@ runs:
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
nistkat: ${{ inputs.nistkat }}
acvp: ${{ inputs.acvp }}
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ jobs:
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
compile_mode: native
func: true
nistkat: true
kat: true
- name: native tests (+debug+memsan+ubsan)
uses: ./.github/actions/multi-functest
with:
Expand All @@ -101,9 +98,6 @@ jobs:
gh_token: ${{ secrets.GITHUB_TOKEN }}
compile_mode: cross
opt: opt
func: true
nistkat: true
kat: true
compiler_tests:
name: Compiler tests (${{ matrix.target.name }})
strategy:
Expand Down Expand Up @@ -133,6 +127,7 @@ jobs:
func: true
nistkat: false
kat: false
acvp: false
nix-shell: "ci_gcc48"
- name: native build+functest (gcc-4.9)
uses: ./.github/actions/multi-functest
Expand All @@ -142,6 +137,7 @@ jobs:
func: true
nistkat: false
kat: false
acvp: false
nix-shell: "ci_gcc49"
- name: native build+functest (gcc-7)
uses: ./.github/actions/multi-functest
Expand All @@ -151,6 +147,7 @@ jobs:
func: true
nistkat: false
kat: false
acvp: false
nix-shell: "ci_gcc7"
- name: native build+functest (gcc-11)
uses: ./.github/actions/multi-functest
Expand All @@ -160,6 +157,7 @@ jobs:
func: true
nistkat: false
kat: false
acvp: false
nix-shell: "ci_gcc11"
- name: native build+functest (clang-18)
uses: ./.github/actions/multi-functest
Expand All @@ -169,6 +167,7 @@ jobs:
func: true
nistkat: false
kat: false
acvp: false
nix-shell: "ci_clang18"
lint:
strategy:
Expand Down Expand Up @@ -230,6 +229,7 @@ jobs:
functest: true
kattest: true
nistkattest: true
acvptest: true
lint: false
verbose: true
secrets: inherit
Expand All @@ -252,6 +252,7 @@ jobs:
functest: true
kattest: false
nistkattest: false
acvptest: false
cbmc: true
cbmc_mlkem_k: 2
secrets: inherit
Expand All @@ -274,6 +275,7 @@ jobs:
functest: true
kattest: false
nistkattest: false
acvptest: false
cbmc: true
cbmc_mlkem_k: 3
secrets: inherit
Expand All @@ -296,6 +298,7 @@ jobs:
functest: true
kattest: false
nistkattest: false
acvptest: false
cbmc: true
cbmc_mlkem_k: 4
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/ci_ec2_any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
functest: ${{ inputs.compile_mode != 'none' }}
kattest: ${{ inputs.compile_mode != 'none' }}
nistkattest: ${{ inputs.compile_mode != 'none' }}
acvptest: ${{ inputs.compile_mode != 'none' }}
lint: true
cbmc: ${{ inputs.cbmc }}
verbose: ${{ inputs.verbose }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ on:
nistkattest:
type: boolean
default: true
acvptest:
type: boolean
default: true
lint:
type: boolean
default: true
Expand Down Expand Up @@ -136,6 +139,7 @@ jobs:
func: ${{ inputs.functest }}
kat: ${{ inputs.kattest }}
nistkat: ${{ inputs.nistkattest }}
acvp: ${{ inputs.acvptest }}
- name: CBMC
if: ${{ inputs.cbmc && (success() || failure()) }}
uses: ./.github/actions/cbmc
Expand Down
4 changes: 3 additions & 1 deletion scripts/lib/mlkem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def bench(
)
f.write(json.dumps(v))

def all(self, func: bool, kat: bool, nistkat: bool):
def all(self, func: bool, kat: bool, nistkat: bool, acvp: bool):
config_logger(self.verbose)

def all(opt: bool):
Expand All @@ -654,6 +654,7 @@ def all(opt: bool):
*([self._func.compile] if func else []),
*([self._nistkat.compile] if nistkat else []),
*([self._kat.compile] if kat else []),
*([self._acvp.compile] if kat else []),
]

for f in compiles:
Expand All @@ -669,6 +670,7 @@ def all(opt: bool):
*([self._run_func] if func else []),
*([self._run_nistkat] if nistkat else []),
*([self._run_kat] if kat else []),
*([self._run_acvp] if acvp else []),
]

for f in runs:
Expand Down
10 changes: 9 additions & 1 deletion scripts/tests
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ def bench(
default=True,
help="Determine whether to run nistkat test or not",
),
click.option(
"--acvp/--no-acvp",
is_flag=True,
show_default=True,
default=True,
help="Determine whether to run acvp test or not",
),
]
)
@click.make_pass_decorator(Options, ensure=True)
Expand All @@ -276,8 +283,9 @@ def all(
func: bool,
kat: bool,
nistkat: bool,
acvp: bool,
):
Tests(opts).all(func, kat, nistkat)
Tests(opts).all(func, kat, nistkat, acvp)


if __name__ == "__main__":
Expand Down

0 comments on commit ba99fb9

Please sign in to comment.