From 55ed84cd5b504bfb7142387d6f51ea4011eb2b71 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sun, 22 Dec 2024 18:58:00 +0000 Subject: [PATCH] [WIP] CI: Attempt to call `make` directly in `functest` action Signed-off-by: Hanno Becker --- .github/actions/functest/action.yml | 6 ++++++ Makefile | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/actions/functest/action.yml b/.github/actions/functest/action.yml index 340d3b73b..f2f321223 100644 --- a/.github/actions/functest/action.yml +++ b/.github/actions/functest/action.yml @@ -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: | diff --git a/Makefile b/Makefile index cee9d27e4..200227960 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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