Debian Codegraph @

.github/workflows/coq-windows.yml

raw symbols SCIP
1 name: CI (Coq, Windows)
2
3 # Note that we must split up each command into a separate step for Windows, because otherwise we don't get error code
4 # See also https://github.com/avsm/setup-ocaml/issues/72
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 # - name: upload timing and .vo info
120 # uses: actions/upload-artifact@v4
121 # with:
122 # name: build-outputs
123 # path: .
124 # if: always ()
125 # - name: validate
126 # run: |
127 # %CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- make TIMED=1 validate COQCHKFLAGS="-o ${COQCHKEXTRAFLAGS}"'
128 # shell: cmd
129 # if: github.event_name != 'pull_request'
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 # IMPORTANT: mandatory for making GitHub Releases
166 steps:
167 - uses: actions/checkout@v4
168 with:
169 fetch-depth: 0 # Fetch all history for all tags and branches
170 tags: true # Fetch all tags as well, `fetch-depth: 0` might be sufficient depending on Git version
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 # Upload to GitHub Release using the `gh` CLI.
190 # `dist/` contains the built packages
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' }}