-
Notifications
You must be signed in to change notification settings - Fork 15
91 lines (89 loc) · 3.3 KB
/
ct-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-License-Identifier: Apache-2.0
name: Constant-time tests
permissions:
contents: read
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
check-ct-varlat:
# Using the patched Valgrind from the KyberSlash paper to detect divisions
# In case the patch no longer applies after an update, we may want to switch back
# to stock valgrind added in https://github.com/pq-code-package/mlkem-native/pull/687
name: CT test ${{ matrix.nix-shell }} ${{ matrix.system }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
system: [ubuntu-latest, pqcp-arm64]
nix-shell:
- ci_valgrind-varlat_clang14
- ci_valgrind-varlat_clang15
- ci_valgrind-varlat_clang16
- ci_valgrind-varlat_clang17
- ci_valgrind-varlat_clang18
- ci_valgrind-varlat_clang19
- ci_valgrind-varlat_gcc48
- ci_valgrind-varlat_gcc49
- ci_valgrind-varlat_gcc7
- ci_valgrind-varlat_gcc11
- ci_valgrind-varlat_gcc12
- ci_valgrind-varlat_gcc13
- ci_valgrind-varlat_gcc14
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup nix
uses: ./.github/actions/setup-shell
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
nix-shell: ${{ matrix.nix-shell }}
nix-cache: true
nix-cache-prefix: valgrind-${{ runner.os }}-${{ runner.arch }}
- name: Build and run test (-Oz)
# -Oz got introduced in gcc12
if: ${{ matrix.nix-shell != 'ci_valgrind-varlat_gcc48' && matrix.nix-shell != 'ci_valgrind-varlat_gcc49' && matrix.nix-shell != 'ci_valgrind-varlat_gcc7' && matrix.nix-shell != 'ci_valgrind-varlat_gcc11'}}
uses: ./.github/actions/ct-test
with:
cflags: -Oz
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-Os)
uses: ./.github/actions/ct-test
with:
cflags: -Os
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O3)
uses: ./.github/actions/ct-test
with:
cflags: -O3
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-Ofast)
# -Ofast got deprecated in clang19; -O3 -ffast-math should be used instead
if: ${{ matrix.nix-shell != 'ci_valgrind-varlat_clang19' }}
uses: ./.github/actions/ct-test
with:
cflags: -Ofast
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O3 -ffast-math)
uses: ./.github/actions/ct-test
with:
cflags: -O3 -ffast-math
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O2)
uses: ./.github/actions/ct-test
with:
cflags: -O2
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O1)
uses: ./.github/actions/ct-test
with:
cflags: -O1
valgrind_flags: --variable-latency-errors=yes
- name: Build and run test (-O0)
uses: ./.github/actions/ct-test
with:
cflags: -O0
valgrind_flags: --variable-latency-errors=yes