Skip to content

Commit

Permalink
Merge pull request #234 from pq-code-package/refactor-build-system-opt
Browse files Browse the repository at this point in the history
Refactor Tests Script for preparing ACVP python script Integration
  • Loading branch information
mkannwischer authored Nov 11, 2024
2 parents ab87498 + e2aa705 commit 9c75556
Show file tree
Hide file tree
Showing 11 changed files with 727 additions and 603 deletions.
4 changes: 2 additions & 2 deletions .github/actions/bench/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ runs:
run: |
./scripts/tests bench -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
--cflags="${{ inputs.cflags }}" --arch-flags="${{ inputs.archflags }}" \
$([[ ${{ inputs.opt }} == "false" ]] && echo "--no-opt") \
--opt=$([[ ${{ inputs.opt }} == "false" ]] && echo "no_opt" || echo "opt") \
-v --output=output.json ${{ inputs.bench_extra_args }}
./scripts/tests bench --components -c ${{ inputs.perf }} --cross-prefix="${{ inputs.cross_prefix }}" \
--cflags="${{ inputs.cflags }}" --arch-flags="${{ inputs.archflags }}" \
$([[ ${{ inputs.opt }} == "false" ]] && echo "--no-opt") \
--opt=$([[ ${{ inputs.opt }} == "false" ]] && echo "no_opt" || echo "opt") \
-v --output=output.json ${{ inputs.bench_extra_args }}
- name: Check namespace
shell: ${{ env.SHELL }}
Expand Down
15 changes: 5 additions & 10 deletions .github/actions/functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ inputs:
description: For auto-determining the default cross-prefix (e.g. native | cross )
default: "native"
opt:
description: opt flag to pass to test script
default: "true"
description: Whether to build opt/non-opt binaries or all (all | opt | no_opt)
default: "all"
func:
description: Determine whether to run functional test or not
default: "true"
Expand All @@ -52,7 +52,6 @@ runs:
fi
echo _CROSS_PREFIX="$_cross_prefix" >> $GITHUB_ENV
echo OPT="${{ inputs.opt == 'true' && 'opt' || 'no-opt' }}" >> $GITHUB_ENV
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
Expand Down Expand Up @@ -84,15 +83,11 @@ runs:
- $(bash --version | grep -m1 "")
- $(${_CROSS_PREFIX}${CC} --version | grep -m1 "")
EOF
- name: Compile ${{ inputs.mode }} ${{ env.OPT }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
shell: ${{ env.SHELL }}
run: |
tests all --cross-prefix="${{ env._CROSS_PREFIX }}" --cflags="${{ inputs.cflags }}" --${{ env.OPT }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.NISTKAT }} --compile --no-run -v
- name: Run ${{ inputs.mode }} ${{ env.OPT }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
- 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 }}" --${{ env.OPT }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.NISTKAT }} --no-compile --run -v
- name: Check namespacing ${{ inputs.mode }} ${{ env.OPT }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
tests all --cross-prefix="${{ env._CROSS_PREFIX }}" --cflags="${{ inputs.cflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.NISTKAT }} -v
- name: Check namespacing ${{ inputs.mode }} ${{ inputs.opt }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
shell: ${{ env.SHELL }}
run: |
check-namespace
Expand Down
44 changes: 7 additions & 37 deletions .github/actions/multi-functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inputs:
description: all | native | cross
default: "native"
opt:
description: all | opt | non-opt
description: all | opt | no_opt
default: "all"
func:
description: Determine whether to run functional test or not
Expand All @@ -40,8 +40,8 @@ inputs:
runs:
using: composite
steps:
- name: Native Opt Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'native') && (inputs.opt == 'all' || inputs.opt == 'opt') }}
- name: Native Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'native') }}
uses: ./.github/actions/functest
with:
nix-shell: ${{ inputs.nix-shell }}
Expand All @@ -51,42 +51,12 @@ runs:
custom_shell: ${{ inputs.custom_shell }}
cflags: ${{ inputs.cflags }}
mode: native
opt: true
opt: ${{ inputs.opt }}
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
nistkat: ${{ inputs.nistkat }}
- name: Native Non-opt Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'native') && (inputs.opt == 'all' || inputs.opt == 'non-opt') && (success() || failure()) }}
uses: ./.github/actions/functest
with:
nix-shell: ${{ inputs.nix-shell }}
nix-cache: ${{ inputs.nix-cache }}
nix-verbose: ${{ inputs.nix-verbose }}
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: ${{ inputs.cflags }}
mode: native
opt: false
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
nistkat: ${{ inputs.nistkat }}
- name: Cross Opt Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross') && (inputs.opt == 'all' || inputs.opt == 'opt') && (success() || failure()) }}
uses: ./.github/actions/functest
with:
nix-shell: ${{ inputs.nix-shell }}
nix-cache: ${{ inputs.nix-cache }}
nix-verbose: ${{ inputs.nix-verbose }}
gh_token: ${{ inputs.gh_token }}
custom_shell: ${{ inputs.custom_shell }}
cflags: ${{ inputs.cflags }}
mode: cross
opt: true
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
nistkat: ${{ inputs.nistkat }}
- name: Cross Non-opt Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross') && (inputs.opt == 'all' || inputs.opt == 'non-opt') && (success() || failure()) }}
- name: Cross Tests
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross') && (success() || failure()) }}
uses: ./.github/actions/functest
with:
nix-shell: ${{ inputs.nix-shell }}
Expand All @@ -96,7 +66,7 @@ runs:
custom_shell: ${{ inputs.custom_shell }}
cflags: ${{ inputs.cflags }}
mode: cross
opt: false
opt: ${{ inputs.opt }}
func: ${{ inputs.func }}
kat: ${{ inputs.kat }}
nistkat: ${{ inputs.nistkat }}
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
opt:
- name: opt
value: true
- name: non-opt
- name: no_opt
value: false
target:
- name: Graviton2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ jobs:
ec2_ami: ubuntu-latest (custom AMI)
ec2_ami_id: ami-08ddb0acd99dc3d33 # aarch64, ubuntu-latest, 64g
compile_mode: native
opt: non-opt
opt: no_opt
lint: false
verbose: true
functest: true
Expand All @@ -268,7 +268,7 @@ jobs:
ec2_ami: ubuntu-latest (custom AMI)
ec2_ami_id: ami-08ddb0acd99dc3d33 # aarch64, ubuntu-latest, 64g
compile_mode: native
opt: non-opt
opt: no_opt
lint: false
verbose: true
functest: true
Expand All @@ -290,7 +290,7 @@ jobs:
ec2_ami: ubuntu-latest (custom AMI)
ec2_ami_id: ami-08ddb0acd99dc3d33 # aarch64, ubuntu-latest, 64g
compile_mode: native
opt: non-opt
opt: no_opt
lint: false
verbose: true
functest: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_ec2_any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ on:
- none
default: all
opt:
description: Indicates to compile and run the opt/non-opt binary or both.
description: Determine whether to compile and run the opt/no_opt binary or both.
type: choice
options:
- all
- opt
- non-opt
- no_opt
default: all
cbmc:
description: Whether to run CBMC proofs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:
default: all
opt:
type: string
description: either all, opt or non-opt
description: either all, opt or no_opt
default: all
functest:
type: boolean
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.vscode
.idea
test/build
__pycache__/
Loading

0 comments on commit 9c75556

Please sign in to comment.