Skip to content

Commit 44e99b1

Browse files
committed
First pass at CI job for hol-light
Signed-off-by: Jake Massimo <[email protected]>
1 parent 3914869 commit 44e99b1

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

.github/workflows/hol_light.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
2+
3+
name: HOL-Light
4+
permissions:
5+
contents: read
6+
on:
7+
push:
8+
branches: ["main"]
9+
paths:
10+
- '.github/workflows/hol_light.yml'
11+
- 'proofs/hol_light/x86_64/Makefile'
12+
- 'proofs/hol_light/x86_64/**/*.S'
13+
- 'proofs/hol_light/x86_64/**/*.ml'
14+
- 'flake.nix'
15+
- 'flake.lock'
16+
- 'nix/hol_light/*'
17+
- 'nix/s2n_bignum/*'
18+
pull_request:
19+
branches: ["main"]
20+
paths:
21+
- '.github/workflows/hol_light.yml'
22+
- 'proofs/hol_light/x86_64/Makefile'
23+
- 'proofs/hol_light/x86_64/**/*.S'
24+
- 'proofs/hol_light/x86_64/**/*.ml'
25+
- 'flake.nix'
26+
- 'flake.lock'
27+
- 'nix/hol_light/*'
28+
- 'nix/s2n_bignum/*'
29+
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
34+
jobs:
35+
# The proofs also check that the byte code is up to date,
36+
# but we use this as a fast path to not even start the proofs
37+
# if the byte code needs updating.
38+
hol_light_bytecode:
39+
name: HOL-Light bytecode check
40+
runs-on: pqcp-x64
41+
if: github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork
42+
steps:
43+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
44+
with:
45+
fetch-depth: 0
46+
- uses: ./.github/actions/setup-shell
47+
with:
48+
gh_token: ${{ secrets.GITHUB_TOKEN }}
49+
nix-shell: 'hol_light'
50+
script: |
51+
autogen --update-hol-light-bytecode --dry-run
52+
hol_light_interactive:
53+
name: HOL-Light interactive shell test
54+
runs-on: pqcp-x64
55+
needs: [ hol_light_bytecode ]
56+
if: github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork
57+
steps:
58+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59+
with:
60+
fetch-depth: 0
61+
- uses: ./.github/actions/setup-shell
62+
with:
63+
gh_token: ${{ secrets.GITHUB_TOKEN }}
64+
nix-shell: 'hol_light'
65+
script: |
66+
make -C proofs/hol_light/x86_64 mldsa/mldsa_ntt.o
67+
echo 'needs "proofs/mldsa_ntt.ml";;' | hol.sh
68+
hol_light_proofs:
69+
needs: [ hol_light_bytecode ]
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
proof:
74+
# Dependencies on {name}.{S,ml} are implicit
75+
- name: mldsa_ntt
76+
needs: ["mldsa_specs.ml", "mldsa_utils.ml"]
77+
name: HOL Light proof for ${{ matrix.proof.name }}.S
78+
runs-on: pqcp-x64
79+
if: github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork
80+
steps:
81+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
82+
with:
83+
fetch-depth: 0
84+
- name: Get changed files
85+
id: changed-files
86+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
87+
- name: Check if dependencies changed
88+
id: check_run
89+
shell: bash
90+
run: |
91+
run_needed=0
92+
changed_files="${{ steps.changed-files.outputs.all_changed_files }}"
93+
dependencies="${{ join(matrix.proof.needs, ' ') }} ${{ format('{0}.S {0}.ml', matrix.proof.name) }}"
94+
for changed in $changed_files; do
95+
for needs in $dependencies; do
96+
if [[ "$changed" == *"$needs" ]]; then
97+
run_needed=1
98+
fi
99+
done
100+
done
101+
102+
# Always re-run upon change to nix files for HOL-Light
103+
if [[ "$changed_files" == *"nix/"* ]] || [[ "$changed_files" == *"hol_light.yml"* ]] || [[ "$changed_files" == *"flake"* ]] || [[ "$changed_files" == *"proofs/hol_light/x86_64/Makefile"* ]]; then
104+
run_needed=1
105+
fi
106+
107+
echo "run_needed=${run_needed}" >> $GITHUB_OUTPUT
108+
- uses: ./.github/actions/setup-shell
109+
if: |
110+
steps.check_run.outputs.run_needed == '1'
111+
with:
112+
gh_token: ${{ secrets.GITHUB_TOKEN }}
113+
nix-shell: 'hol_light'
114+
script: |
115+
tests hol_light -p ${{ matrix.proof.name }} --verbose

0 commit comments

Comments
 (0)