-
Notifications
You must be signed in to change notification settings - Fork 147
256 lines (243 loc) · 9.04 KB
/
coq-docker.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
name: CI (Coq, docker, dev)
on:
push:
branches: [ master , sp2019latest , v8.6 , v8.8 , v8.10 ]
pull_request:
merge_group:
workflow_dispatch:
release:
types: [published]
schedule:
- cron: '0 0 1 * *'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- env: { COQ_VERSION: "master", DOCKER_COQ_VERSION: "dev", DOCKER_OCAML_VERSION: "default", SKIP_VALIDATE: "" , COQCHKEXTRAFLAGS: "-bytecode-compiler yes", EXTRA_GH_REPORTIFY: "--warnings", ALLOW_DIFF: "1" }
os: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
env: ${{ matrix.env }}
name: ${{ matrix.env.COQ_VERSION }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.env.COQ_VERSION }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: echo host build params
run: etc/ci/describe-system-config.sh
- name: echo container build params
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.env.DOCKER_COQ_VERSION }}
ocaml_version: ${{ matrix.env.DOCKER_OCAML_VERSION }}
export: CI ALLOW_DIFF COQCHKEXTRAFLAGS
custom_script: |
eval $(opam env)
etc/ci/describe-system-config.sh
- name: deps
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.env.DOCKER_COQ_VERSION }}
ocaml_version: ${{ matrix.env.DOCKER_OCAML_VERSION }}
export: CI ALLOW_DIFF COQCHKEXTRAFLAGS
custom_script: etc/ci/github-actions-docker-make.sh -j2 deps
- name: all-except-generated
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.env.DOCKER_COQ_VERSION }}
ocaml_version: ${{ matrix.env.DOCKER_OCAML_VERSION }}
export: CI ALLOW_DIFF COQCHKEXTRAFLAGS
custom_script: etc/ci/github-actions-docker-make.sh ${EXTRA_GH_REPORTIFY} -j2 all-except-generated
- name: generated-files
run: etc/ci/github-actions-make.sh ${EXTRA_GH_REPORTIFY} -f Makefile.examples -j2 generated-files
if: github.event_name == 'pull_request' || ${{ matrix.env.COQ_VERSION }} != 'master'
- run: tar -czvf generated-files.tgz fiat-*/
if: ${{ failure() }}
- name: upload generated files
uses: actions/upload-artifact@v3
with:
name: generated-files-${{ matrix.env.COQ_VERSION }}
path: generated-files.tgz
if: ${{ failure() }}
- name: package-standalone-ocaml
run: etc/ci/github-actions-make.sh -f Makefile.standalone package-standalone-ocaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-docker-coq-${{ matrix.env.DOCKER_COQ_VERSION }}
path: standalone.tar.gz
- name: upload OCaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionOCaml-${{ matrix.env.COQ_VERSION }}
path: src/ExtractionOCaml
if: always ()
- name: standalone-haskell
run: etc/ci/github-actions-make.sh -f Makefile.standalone -j1 standalone-haskell GHCFLAGS='+RTS -M6G -RTS'
- name: upload Haskell files
uses: actions/upload-artifact@v3
with:
name: ExtractionHaskell-${{ matrix.env.COQ_VERSION }}
path: src/ExtractionHaskell
if: always ()
- name: display timing info
run: cat time-of-build-pretty.log
- name: display per-line timing info
run: etc/ci/github-actions-display-per-line-timing.sh
# - name: upload timing and .vo info
# uses: actions/upload-artifact@v3
# with:
# name: build-outputs-${{ matrix.env.COQ_VERSION }}
# path: .
# if: always ()
- name: validate
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.env.DOCKER_COQ_VERSION }}
ocaml_version: ${{ matrix.env.DOCKER_OCAML_VERSION }}
export: CI ALLOW_DIFF COQCHKEXTRAFLAGS
custom_script: etc/ci/github-actions-docker-make.sh TIMED=1 validate COQCHKFLAGS="-o ${COQCHKEXTRAFLAGS}"
if: env.SKIP_VALIDATE == '' && github.event_name != 'pull_request'
test-amd64:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-test-amd64-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
needs: build
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download a Build Artifact
uses: actions/download-artifact@v3
with:
name: ExtractionOCaml-master
path: src/ExtractionOCaml
- name: make binaries executable
run: git check-ignore src/ExtractionOCaml/* | grep -v '\.' | xargs chmod +x
- name: only-test-amd64-files
run: etc/ci/github-actions-make.sh -f Makefile.examples -j2 only-test-amd64-files SLOWEST_FIRST=1
env:
ALLOW_DIFF: 1
test-standalone:
strategy:
fail-fast: false
matrix:
include:
- coq-version: master
docker-coq-version: dev
docker-ocaml-version: default
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download standalone Docker
uses: actions/download-artifact@v3
with:
name: standalone-docker-coq-${{ matrix.docker-coq-version }}
path: dist-docker-coq-${{ matrix.docker-coq-version }}/
- name: List files
run: find dist-docker-coq-${{ matrix.docker-coq-version }}
- name: Rename files
run: |
mkdir dist
mv dist-docker-coq-${{ matrix.docker-coq-version }}/standalone.tar.gz dist/fiat-crypto-docker-coq-${{ matrix.docker-coq-version }}.tar.gz
find dist
tar -tvf dist/fiat-crypto-docker-coq-${{ matrix.docker-coq-version }}.tar.gz
- name: Unpack Files
run: |
cd dist
tar -xzvf fiat-crypto-docker-coq-${{ matrix.docker-coq-version }}.tar.gz
ls -la .
- name: Test files (host)
run: |
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
- name: Test files (container)
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.docker-coq-version }}
ocaml_version: ${{ matrix.docker-ocaml-version }}
custom_script: |
echo "::group::install dependencies"
sudo apt-get update -y
sudo apt-get install -y file
echo "::endgroup::"
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
publish-standalone-dry-run:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
steps:
- uses: actions/checkout@v4
- name: Download standalone Docker
uses: actions/download-artifact@v3
with:
name: standalone-docker-coq-dev
path: dist-docker-coq-dev/
- name: List files
run: find dist-docker-coq-dev
- name: Unpack files
run: |
mkdir dist
mv dist-docker-coq-dev/standalone.tar.gz dist/fiat-crypto-docker-coq-dev.tar.gz
find dist
tar -tvf dist/fiat-crypto-docker-coq-dev.tar.gz
# - name: Upload artifacts to GitHub Release
# env:
# GITHUB_TOKEN: ${{ github.token }}
# # Upload to GitHub Release using the `gh` CLI.
# # `dist/` contains the built packages
# run: >-
# gh release upload
# '${{ github.ref_name }}' dist/**
# --repo '${{ github.repository }}'
# if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}
docker-check-all:
runs-on: ubuntu-latest
needs: [build, test-amd64, test-standalone, publish-standalone-dry-run]
if: always()
steps:
- run: echo 'build passed'
if: ${{ needs.build.result == 'success' }}
- run: echo 'test-amd64 passed'
if: ${{ needs.test-amd64.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone.result == 'success' }}
- run: echo 'publish-standalone-dry-run passed'
if: ${{ needs.publish-standalone-dry-run.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'test-amd64 failed' && false
if: ${{ needs.test-amd64.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone.result != 'success' }}
- run: echo 'publish-standalone-dry-run failed' && false
if: ${{ needs.publish-standalone-dry-run.result != 'success' }}