Skip to content

Commit 4855e1c

Browse files
committed
CI: Add ACVP tests in CI
Resolves #4 Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent 91a2218 commit 4855e1c

3 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/all.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) The mlkem-native project authors
2+
# Copyright (c) The slhdsa-native project authors
3+
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
4+
5+
name: CI
6+
permissions:
7+
contents: read
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches: ["main"]
12+
pull_request:
13+
branches: ["main"]
14+
types: [ "opened", "synchronize" ]
15+
16+
jobs:
17+
base:
18+
name: Base
19+
permissions:
20+
contents: 'read'
21+
id-token: 'write'
22+
uses: ./.github/workflows/base.yml
23+
secrets: inherit

.github/workflows/base.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) The mlkem-native project authors
2+
# Copyright (c) The slhdsa-native project authors
3+
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
4+
5+
name: Base
6+
permissions:
7+
contents: read
8+
on:
9+
workflow_call:
10+
workflow_dispatch:
11+
12+
jobs:
13+
quickcheck:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
external:
18+
- ${{ github.repository_owner != 'pq-code-package' }}
19+
target:
20+
- runner: pqcp-arm64
21+
name: 'aarch64'
22+
- runner: ubuntu-latest
23+
name: 'x86_64'
24+
- runner: macos-latest
25+
name: 'macos (aarch64)'
26+
- runner: macos-13
27+
name: 'macos (x86_64)'
28+
exclude:
29+
- {external: true,
30+
target: {
31+
runner: pqcp-arm64,
32+
name: 'aarch64'
33+
}}
34+
name: Quickcheck (${{ matrix.target.name }})
35+
runs-on: ${{ matrix.target.runner }}
36+
steps:
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
submodules: true
40+
- name: make quickcheck
41+
run: |
42+
make quickcheck

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ test: $(XTEST) test/acvp_cases.sh
4242
@echo "SKIP:" `grep -c SKIP test.log`
4343
@echo "FAIL:" `grep -c FAIL test.log`
4444

45+
# do not rely on parallel in CI
46+
quickcheck: $(XTEST) test/acvp_cases.sh
47+
bash test/acvp_cases.sh | tee test.log
48+
@echo "=== test summary ==="
49+
@echo "PASS:" `grep -c PASS test.log`
50+
@echo "SKIP:" `grep -c SKIP test.log`
51+
@echo "FAIL:" `grep -c FAIL test.log`
52+
@skips=`grep -c SKIP test.log`; \
53+
fails=`grep -c FAIL test.log`; \
54+
if [ "$$skips" -ne 0 ] || [ "$$fails" -ne 0 ]; then \
55+
echo "Test failed: SKIP=$$skips, FAIL=$$fails"; \
56+
exit 1; \
57+
else \
58+
echo "ALL GOOD!"; \
59+
fi
60+
4561
test/acvp_cases.sh:
4662
cd test && $(MAKE) acvp_cases.sh
4763

0 commit comments

Comments
 (0)