Skip to content

Commit

Permalink
[WIP] CI: Attempt to call make directly in functest 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 Dec 22, 2024
1 parent b99707b commit 55ed84c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/actions/functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ runs:
- $(python3 --version)
- $(${{ inputs.cross_prefix }}${CC} --version | grep -m1 "")
EOF
- name: ${{ env.MODE }} ${{ inputs.opt }} tests (no-opt, func)
if: ${{ inputs.func == 'true' && (inputs.opt == 'no-opt' || inputs.opt == 'all') }}
shell: ${{ env.SHELL }}
run: |
make clean
CFLAGS="${{ inputs.cflags }}" make EXEC_WRAPPER="${{ inputs.exec_wrapper }}" CROSS_PREFIX="${{ inputs.cross_prefix }}" AUTO=1 OPT=0 check_func
- name: ${{ env.MODE }} ${{ inputs.opt }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }})
shell: ${{ env.SHELL }}
run: |
Expand Down
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ include mk/crypto.mk
include mk/schemes.mk
include mk/rules.mk

# Binary wrapper, e.g. qemu-aarch64/qemu-x86_64 for emulation.
# Usually chosen consistently with CROSS_PREFIX for compilation.
WRAP?=

quickcheck: checkall

buildall: mlkem nistkat kat acvp
Expand All @@ -19,19 +23,19 @@ checkall: buildall check_kat check_nistkat check_func check_acvp
$(Q)echo " Everything checks fine!"

check_kat: buildall
$(MLKEM512_DIR)/bin/gen_KAT512 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-512 kat-sha256
$(MLKEM768_DIR)/bin/gen_KAT768 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-768 kat-sha256
$(MLKEM1024_DIR)/bin/gen_KAT1024 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-1024 kat-sha256
$(WRAP) $(MLKEM512_DIR)/bin/gen_KAT512 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-512 kat-sha256
$(WRAP) $(MLKEM768_DIR)/bin/gen_KAT768 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-768 kat-sha256
$(WRAP) $(MLKEM1024_DIR)/bin/gen_KAT1024 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-1024 kat-sha256

check_nistkat: buildall
$(MLKEM512_DIR)/bin/gen_NISTKAT512 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-512 nistkat-sha256
$(MLKEM768_DIR)/bin/gen_NISTKAT768 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-768 nistkat-sha256
$(MLKEM1024_DIR)/bin/gen_NISTKAT1024 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-1024 nistkat-sha256
$(WRAP) $(MLKEM512_DIR)/bin/gen_NISTKAT512 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-512 nistkat-sha256
$(WRAP) $(MLKEM768_DIR)/bin/gen_NISTKAT768 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-768 nistkat-sha256
$(WRAP) $(MLKEM1024_DIR)/bin/gen_NISTKAT1024 | sha256sum | cut -d " " -f 1 | xargs ./META.sh ML-KEM-1024 nistkat-sha256

check_func: buildall
$(MLKEM512_DIR)/bin/test_mlkem512
$(MLKEM768_DIR)/bin/test_mlkem768
$(MLKEM1024_DIR)/bin/test_mlkem1024
$(WRAP) $(MLKEM512_DIR)/bin/test_mlkem512
$(WRAP) $(MLKEM768_DIR)/bin/test_mlkem768
$(WRAP) $(MLKEM1024_DIR)/bin/test_mlkem1024

check_acvp: buildall
python3 ./test/acvp_client.py
Expand Down

0 comments on commit 55ed84c

Please sign in to comment.