| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
name: HOL-Light |
| 5 |
permissions: |
| 6 |
contents: read |
| 7 |
on: |
| 8 |
push: |
| 9 |
branches: ["main"] |
| 10 |
paths: |
| 11 |
- '.github/workflows/hol_light.yml' |
| 12 |
- 'proofs/hol_light/x86_64/Makefile' |
| 13 |
- 'proofs/hol_light/x86_64/**/*.S' |
| 14 |
- 'proofs/hol_light/x86_64/**/*.ml' |
| 15 |
- 'nix/hol_light/*' |
| 16 |
- 'nix/s2n_bignum/*' |
| 17 |
pull_request: |
| 18 |
branches: ["main"] |
| 19 |
paths: |
| 20 |
- '.github/workflows/hol_light.yml' |
| 21 |
- 'proofs/hol_light/x86_64/Makefile' |
| 22 |
- 'proofs/hol_light/x86_64/**/*.S' |
| 23 |
- 'proofs/hol_light/x86_64/**/*.ml' |
| 24 |
- 'nix/hol_light/*' |
| 25 |
- 'nix/s2n_bignum/*' |
| 26 |
|
| 27 |
concurrency: |
| 28 |
group: ${{ github.workflow }}-${{ github.ref }} |
| 29 |
cancel-in-progress: true |
| 30 |
|
| 31 |
jobs: |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
hol_light_bytecode: |
| 36 |
name: HOL-Light bytecode check |
| 37 |
runs-on: pqcp-x64 |
| 38 |
if: github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork |
| 39 |
steps: |
| 40 |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 41 |
with: |
| 42 |
fetch-depth: 0 |
| 43 |
- uses: ./.github/actions/setup-shell |
| 44 |
with: |
| 45 |
gh_token: ${{ secrets.GITHUB_TOKEN }} |
| 46 |
nix-shell: 'hol_light' |
| 47 |
script: | |
| 48 |
autogen --update-hol-light-bytecode --dry-run |
| 49 |
hol_light_interactive: |
| 50 |
name: HOL-Light interactive shell test |
| 51 |
runs-on: pqcp-x64 |
| 52 |
needs: [ hol_light_bytecode ] |
| 53 |
if: github.repository_owner == 'pq-code-package' && !github.event.pull_request.head.repo.fork |
| 54 |
steps: |
| 55 |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 56 |
with: |
| 57 |
fetch-depth: 0 |
| 58 |
- uses: ./.github/actions/setup-shell |
| 59 |
with: |
| 60 |
gh_token: ${{ secrets.GITHUB_TOKEN }} |
| 61 |
nix-shell: 'hol_light' |
| 62 |
script: | |
| 63 |
# Load base infrastructure and specs to validate HOL-Light environment |
| 64 |
# When we have smaller/faster proofs, we can run them here instead: |
| 65 |
# make -C proofs/hol_light/x86_64 mldsa/mldsa_ntt.o |
| 66 |
# echo 'needs "proofs/mldsa_ntt.ml";;' | hol.sh |
| 67 |
echo 'needs "x86/proofs/base.ml";; needs "proofs/mldsa_specs.ml";; #quit;;' | hol.sh |
| 68 |
hol_light_proofs: |
| 69 |
needs: [ hol_light_bytecode ] |
| 70 |
strategy: |
| 71 |
fail-fast: false |
| 72 |
matrix: |
| 73 |
proof: |
| 74 |
|
| 75 |
- name: mldsa_ntt |
| 76 |
needs: ["mldsa_specs.ml", "mldsa_utils.ml", "mldsa_zetas.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 |
| 82 |
with: |
| 83 |
fetch-depth: 0 |
| 84 |
- name: Get changed files |
| 85 |
id: changed-files |
| 86 |
uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 |
| 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 |