| 1 |
name: CI (Coq, Windows) |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
on: |
| 7 |
push: |
| 8 |
branches: [ master , sp2019latest , v8.6 , v8.8 , v8.10 ] |
| 9 |
pull_request: |
| 10 |
merge_group: |
| 11 |
workflow_dispatch: |
| 12 |
release: |
| 13 |
types: [published] |
| 14 |
schedule: |
| 15 |
- cron: '0 0 1 * *' |
| 16 |
|
| 17 |
jobs: |
| 18 |
build: |
| 19 |
|
| 20 |
runs-on: windows-latest |
| 21 |
name: windows |
| 22 |
|
| 23 |
concurrency: |
| 24 |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 25 |
cancel-in-progress: true |
| 26 |
|
| 27 |
env: |
| 28 |
NJOBS: "2" |
| 29 |
COQ_VERSION: "8.20.0" |
| 30 |
COQEXTRAFLAGS: "-async-proofs-j 1" |
| 31 |
COQCHKEXTRAFLAGS: "" |
| 32 |
OPAMYES: "true" |
| 33 |
OPAMCONFIRMLEVEL: "unsafe-yes" |
| 34 |
|
| 35 |
steps: |
| 36 |
- uses: actions/checkout@v4 |
| 37 |
with: |
| 38 |
submodules: recursive |
| 39 |
- name: Setup Python |
| 40 |
uses: actions/setup-python@v5 |
| 41 |
with: |
| 42 |
python-version: 3.x |
| 43 |
- name: Set up OCaml |
| 44 |
uses: ocaml/setup-ocaml@v3 |
| 45 |
with: |
| 46 |
ocaml-compiler: 4.13.1 |
| 47 |
- run: opam install conf-time conf-gcc |
| 48 |
- run: opam install 'ocamlfind>=1.9.7' |
| 49 |
- run: opam pin add --kind=version coq ${{ env.COQ_VERSION }} |
| 50 |
- run: opam install js_of_ocaml |
| 51 |
- name: Work around https://github.com/actions/checkout/issues/766 |
| 52 |
run: opam exec -- bash -l -c 'git config --global --add safe.directory "*"' |
| 53 |
- name: echo build params |
| 54 |
run: .\etc\ci\describe-system-config-win.ps1 |
| 55 |
- name: deps |
| 56 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j${{ env.NJOBS }} CC=gcc deps |
| 57 |
- name: standalone-ocaml |
| 58 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j${{ env.NJOBS }} standalone-ocaml |
| 59 |
- name: install-standalone-unified-ocaml |
| 60 |
run: opam exec -- bash etc/ci/github-actions-make.sh install-standalone-unified-ocaml BINDIR=dist |
| 61 |
|
| 62 |
- name: coq |
| 63 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j1 coq |
| 64 |
- name: all-except-generated-and-js-of-ocaml |
| 65 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j1 all-except-generated-and-js-of-ocaml |
| 66 |
- name: standalone-js-of-ocaml |
| 67 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j1 standalone-js-of-ocaml |
| 68 |
- name: install-standalone-js-of-ocaml |
| 69 |
run: opam exec -- bash etc/ci/github-actions-make.sh install-standalone-js-of-ocaml |
| 70 |
- name: c-files lite-generated-files |
| 71 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j${{ env.NJOBS }} c-files lite-generated-files |
| 72 |
- name: only-test-amd64-files-lite |
| 73 |
run: opam exec -- bash etc/ci/github-actions-make.sh -j${{ env.NJOBS }} only-test-amd64-files-lite SLOWEST_FIRST=1 |
| 74 |
- name: aggregate timing files for upload |
| 75 |
run: | |
| 76 |
$files = Get-ChildItem -Path . -Filter "*.timing" -Recurse |
| 77 |
$files | ForEach-Object { Write-Output "Adding: $_" } |
| 78 |
$files | Compress-Archive -DestinationPath timing-files.zip -Force |
| 79 |
shell: pwsh |
| 80 |
if: failure() |
| 81 |
- name: upload generated timing files |
| 82 |
uses: actions/upload-artifact@v4 |
| 83 |
with: |
| 84 |
name: timing-files-windows |
| 85 |
path: timing-files.zip |
| 86 |
if: failure() |
| 87 |
- name: upload OCaml files |
| 88 |
uses: actions/upload-artifact@v4 |
| 89 |
with: |
| 90 |
name: ExtractionOCaml |
| 91 |
path: src/ExtractionOCaml |
| 92 |
- name: upload js_of_ocaml files |
| 93 |
uses: actions/upload-artifact@v4 |
| 94 |
with: |
| 95 |
name: ExtractionJsOfOCaml |
| 96 |
path: src/ExtractionJsOfOCaml |
| 97 |
- name: upload standalone files |
| 98 |
uses: actions/upload-artifact@v4 |
| 99 |
with: |
| 100 |
name: standalone-windows |
| 101 |
path: dist/fiat_crypto.exe |
| 102 |
- name: upload standalone js files |
| 103 |
uses: actions/upload-artifact@v4 |
| 104 |
with: |
| 105 |
name: standalone-html-windows |
| 106 |
path: fiat-html |
| 107 |
- name: install |
| 108 |
run: opam exec -- bash etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml |
| 109 |
- name: install-without-bedrock2 |
| 110 |
run: opam exec -- bash etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml |
| 111 |
- name: install-dev |
| 112 |
run: opam exec -- bash etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml |
| 113 |
- name: display timing info |
| 114 |
run: type time-of-build-pretty.log |
| 115 |
shell: cmd |
| 116 |
- name: display per-line timing info |
| 117 |
run: etc/ci/github-actions-display-per-line-timing.sh |
| 118 |
shell: bash |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
test-standalone: |
| 132 |
runs-on: windows-latest |
| 133 |
needs: build |
| 134 |
steps: |
| 135 |
- uses: actions/checkout@v4 |
| 136 |
- name: Download standalone Windows |
| 137 |
uses: actions/download-artifact@v4 |
| 138 |
with: |
| 139 |
name: standalone-windows |
| 140 |
path: dist/ |
| 141 |
- name: List files |
| 142 |
run: Get-ChildItem dist -Name |
| 143 |
- run: .\dist\fiat_crypto.exe -h |
| 144 |
- run: .\dist\fiat_crypto.exe word-by-word-montgomery -h |
| 145 |
- run: .\dist\fiat_crypto.exe unsaturated-solinas -h |
| 146 |
- run: .\dist\fiat_crypto.exe saturated-solinas -h |
| 147 |
- run: .\dist\fiat_crypto.exe base-conversion -h |
| 148 |
- name: Set up MSVC Environment for dumpbin |
| 149 |
uses: ilammy/msvc-dev-cmd@v1 |
| 150 |
- name: Check Executable Dependencies |
| 151 |
run: | |
| 152 |
Write-Host "::group::File Info - fiat_crypto" |
| 153 |
Get-Item .\dist\fiat_crypto.exe | Format-List |
| 154 |
dumpbin.exe /headers .\dist\fiat_crypto.exe |
| 155 |
Write-Host "::endgroup::" |
| 156 |
|
| 157 |
Write-Host "::group::DLL Dependencies - fiat_crypto" |
| 158 |
dumpbin.exe /dependents .\dist\fiat_crypto.exe |
| 159 |
Write-Host "::endgroup::" |
| 160 |
|
| 161 |
publish-standalone: |
| 162 |
runs-on: ubuntu-latest |
| 163 |
needs: build |
| 164 |
permissions: |
| 165 |
contents: write |
| 166 |
steps: |
| 167 |
- uses: actions/checkout@v4 |
| 168 |
with: |
| 169 |
fetch-depth: 0 |
| 170 |
tags: true |
| 171 |
- name: Download standalone Windows |
| 172 |
uses: actions/download-artifact@v4 |
| 173 |
with: |
| 174 |
name: standalone-windows |
| 175 |
path: dist/ |
| 176 |
- name: List files |
| 177 |
run: find dist |
| 178 |
- name: Rename files |
| 179 |
run: | |
| 180 |
arch="$(etc/ci/find-arch.sh dist/fiat_crypto.exe "x86_64")" |
| 181 |
tag="$(git describe --tags HEAD)" |
| 182 |
fname="Fiat-Cryptography_${tag}_Windows_${arch}.exe" |
| 183 |
echo "$fname" |
| 184 |
mv dist/fiat_crypto.exe "dist/$fname" |
| 185 |
find dist |
| 186 |
- name: Upload artifacts to GitHub Release |
| 187 |
env: |
| 188 |
GITHUB_TOKEN: ${{ github.token }} |
| 189 |
|
| 190 |
|
| 191 |
run: >- |
| 192 |
gh release upload |
| 193 |
'${{ github.ref_name }}' dist/** |
| 194 |
--repo '${{ github.repository }}' |
| 195 |
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }} |
| 196 |
|
| 197 |
windows-check-all: |
| 198 |
runs-on: ubuntu-latest |
| 199 |
needs: [build, test-standalone, publish-standalone] |
| 200 |
if: always() |
| 201 |
steps: |
| 202 |
- run: echo 'build passed' |
| 203 |
if: ${{ needs.build.result == 'success' }} |
| 204 |
- run: echo 'test-standalone passed' |
| 205 |
if: ${{ needs.test-standalone.result == 'success' }} |
| 206 |
- run: echo 'publish-standalone passed' |
| 207 |
if: ${{ needs.publish-standalone.result == 'success' }} |
| 208 |
- run: echo 'build failed' && false |
| 209 |
if: ${{ needs.build.result != 'success' }} |
| 210 |
- run: echo 'test-standalone failed' && false |
| 211 |
if: ${{ needs.test-standalone.result != 'success' }} |
| 212 |
- run: echo 'publish-standalone failed' && false |
| 213 |
if: ${{ needs.publish-standalone.result != 'success' }} |