-
Notifications
You must be signed in to change notification settings - Fork 12
143 lines (141 loc) · 4.45 KB
/
ci.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["main"]
jobs:
build_kat:
strategy:
fail-fast: false
matrix:
external:
- ${{ github.repository_owner != 'pq-code-package' }}
target:
- runner: macos-latest
name: 'MacOS'
arch: 'arm64'
cross-prefix: ' '
cflags: '-DFORCE_AARCH64'
- runner: pqcp-arm64
name: 'ubuntu-latest (aarch64)'
arch: 'aarch64'
cross-prefix: ' '
cflags: '-DFORCE_AARCH64'
- runner: ubuntu-latest
name: 'ubuntu-latest (x86_64)'
arch: 'x86_64'
cross-prefix: 'aarch64-unknown-linux-gnu-'
cflags: '-DFORCE_AARCH64'
exclude:
- external: true
target:
- runner: 'pqcp-arm64'
name: 'ubuntu-latest (aarch64)'
name: build_kat (${{ matrix.target.name }})
runs-on: ${{ matrix.target.runner }}
defaults:
run:
shell: nix develop .#ci -c bash -e {0}
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: ./.github/actions/setup-nix
with:
devShell: ci
script: |
ARCH=$(uname -m)
cat >> $GITHUB_STEP_SUMMARY <<-EOF
## Setup
Architecture: $ARCH
- $(uname -a)
- $(nix --version)
- $(astyle --version)
- $(${{ matrix.target.cross-prefix }}gcc --version | grep -m1 "")
- $(bash --version | grep -m1 "")
EOF
if [[ "$ARCH" != ${{ matrix.target.arch }} ]]; then
echo ":x: Expecting to run on ${{ matrix.target.arch }}, but instead running on $ARCH" >> $GITHUB_STEP_SUMMARY
exit 1
fi
- name: Run functional tests
id: func_test
run: |
tests func --cross-prefix=${{ matrix.target.cross-prefix }} --cflags ${{ matrix.target.cflags }} -v
- name: Run KAT tests
id: kat_test
if: |
success()
|| steps.func_test.conclusion == 'failure'
run: |
tests kat --cross-prefix=${{ matrix.target.cross-prefix }} --cflags ${{ matrix.target.cflags }} -v
- name: Run Nistkat tests
id: nistkat_test
if: |
success()
|| steps.func_test.conclusion == 'failure'
|| steps.kat_test.conclusion == 'failure'
run: |
tests nistkat --cross-prefix=${{ matrix.target.cross-prefix }} --cflags ${{ matrix.target.cflags }} -v
lint:
strategy:
matrix:
system: [ubuntu-latest]
runs-on: ${{ matrix.system }}
defaults:
run:
shell: nix develop .#ci-linter -c bash -e {0}
env:
CROSS_PREFIX: "${{ (matrix.system == 'ubuntu-latest' && 'aarch64-unknown-linux-gnu-') || '' }}"
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: ./.github/actions/setup-nix
with:
devShell: ci-linter
script: |
cat >> $GITHUB_STEP_SUMMARY << EOF
## Setup
Architecture: $(uname -m)
- $(uname -a)
- $(nix --version)
- $(astyle --version)
- $(${{ matrix.target.cross-prefix }}gcc --version | grep -m1 "")
- $(bash --version | grep -m1 "")
EOF
- name: Lint
run: |
echo "## Lint & Checks" >> $GITHUB_STEP_SUMMARY
lint
cbmc:
strategy:
matrix:
system: [macos-latest]
runs-on: ${{ matrix.system }}
defaults:
run:
shell: nix develop .#ci-cbmc -c bash -e {0}
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: ./.github/actions/setup-nix
with:
devShell: ci-cbmc
script: |
cat >> $GITHUB_STEP_SUMMARY << EOF
## Setup
Architecture: $(uname -m)
- $(nix --version)
- $(cbmc --version)
- litani Version $(litani --version)
- Cadical Version $(cadical --version)
- $(${{ matrix.cross_prefix }}gcc --version | grep -m1 "")
- $(bash --version | grep -m1 "")
EOF
- name: Run CBMC proofs
run: |
cd cbmc/proofs;
KYBER_K=2 ./run-cbmc-proofs.py --summarize;
KYBER_K=3 ./run-cbmc-proofs.py --summarize;
KYBER_K=4 ./run-cbmc-proofs.py --summarize;