Debian Codegraph @

.github/workflows/coq-alpine.yml

raw symbols SCIP
1 name: CI (Coq, Alpine)
2
3 on:
4 push:
5 branches: [ master ]
6 pull_request:
7 merge_group:
8 workflow_dispatch:
9 release:
10 types: [published]
11 schedule:
12 - cron: '0 0 1 * *'
13
14 jobs:
15 build:
16
17 strategy:
18 fail-fast: false
19 matrix:
20 include:
21 - alpine: 'edge'
22 # - alpine: 'latest-stable'
23
24 runs-on: ubuntu-latest
25 name: alpine-${{ matrix.alpine }}
26
27 concurrency:
28 group: ${{ github.workflow }}-alpine-${{ matrix.alpine }}-${{ github.head_ref || github.run_id }}
29 cancel-in-progress: true
30
31 steps:
32 - uses: actions/checkout@v4
33 with:
34 submodules: recursive
35 - uses: jirutka/setup-alpine@v1
36 with:
37 branch: ${{ matrix.alpine }}
38 extra-repositories: https://dl-cdn.alpinelinux.org/alpine/edge/testing
39 packages: git make jq gcc musl-dev python3 ocaml ocaml-findlib ghc cabal rocq rocq-stdlib ocaml-zarith bash sudo
40 - name: host build params
41 run: etc/ci/describe-system-config.sh
42 - name: chroot build params
43 shell: alpine.sh {0}
44 run: etc/ci/describe-system-config.sh
45 - name: etc/ci/github-actions-make.sh deps
46 shell: alpine.sh {0}
47 run: etc/ci/github-actions-make.sh -j2 deps
48 - name: all-except-generated-and-js-of-ocaml
49 shell: alpine.sh {0}
50 run: etc/ci/github-actions-make.sh -j2 CAMLEXTRAFLAGS="-ccopt -static" all-except-generated-and-js-of-ocaml
51 - name: install-standalone-unified-ocaml
52 shell: alpine.sh {0}
53 run: make install-standalone-unified-ocaml BINDIR=dist
54 # - name: install-standalone-js-of-ocaml
55 # shell: alpine.sh {0}
56 # run: make install-standalone-js-of-ocaml
57 - name: upload standalone files
58 uses: actions/upload-artifact@v4
59 with:
60 name: standalone-${{ matrix.alpine }}
61 path: dist/fiat_crypto
62 # - name: upload standalone js files
63 # uses: actions/upload-artifact@v4
64 # with:
65 # name: standalone-html-${{ matrix.alpine }}
66 # path: fiat-html
67 - name: upload OCaml files
68 uses: actions/upload-artifact@v4
69 with:
70 name: ExtractionOCaml-${{ matrix.alpine }}
71 path: src/ExtractionOCaml
72 if: always ()
73 # - name: upload js_of_ocaml files
74 # uses: actions/upload-artifact@v4
75 # with:
76 # name: ExtractionJsOfOCaml-${{ matrix.alpine }}
77 # path: src/ExtractionJsOfOCaml
78 # if: always ()
79 - name: generated-files
80 shell: alpine.sh {0}
81 run: etc/ci/github-actions-make.sh -j2 generated-files
82 - run: tar -czvf generated-files.tgz fiat-*/
83 if: failure()
84 - name: upload generated files
85 uses: actions/upload-artifact@v4
86 with:
87 name: generated-files-${{ matrix.alpine }}
88 path: generated-files.tgz
89 if: failure()
90 - run: find . -name "*.timing" | xargs tar -czvf timing-files.tgz
91 if: failure()
92 - name: upload generated timing files
93 uses: actions/upload-artifact@v4
94 with:
95 name: timing-files-${{ matrix.alpine }}
96 path: timing-files.tgz
97 if: failure()
98 - name: standalone-haskell
99 shell: alpine.sh {0}
100 run: etc/ci/github-actions-make.sh -j1 standalone-haskell GHCFLAGS='+RTS -M7G -RTS'
101 - name: upload Haskell files
102 uses: actions/upload-artifact@v4
103 with:
104 name: ExtractionHaskell-${{ matrix.alpine }}
105 path: src/ExtractionHaskell
106 if: always ()
107 - name: only-test-amd64-files-lite
108 shell: alpine.sh {0}
109 run: etc/ci/github-actions-make.sh -j2 only-test-amd64-files-lite SLOWEST_FIRST=1
110 - name: install
111 shell: alpine.sh {0}
112 run: sudo make EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml
113 - name: install-without-bedrock2
114 shell: alpine.sh {0}
115 run: sudo make EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml
116 - name: install-dev
117 shell: alpine.sh {0}
118 run: sudo make EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml
119 - name: display timing info
120 run: cat time-of-build-pretty.log || true
121 - name: display per-line timing info
122 run: etc/ci/github-actions-display-per-line-timing.sh
123
124 test-standalone:
125 strategy:
126 fail-fast: false
127 matrix:
128 include:
129 - alpine: 'edge'
130 # - alpine: 'latest-stable'
131 runs-on: ubuntu-latest
132 name: test-standalone-${{ matrix.alpine }}
133 needs: build
134 steps:
135 - uses: actions/checkout@v4
136 - name: Download standalone ${{ matrix.alpine }}
137 uses: actions/download-artifact@v4
138 with:
139 name: standalone-${{ matrix.alpine }}
140 path: dist/
141 - name: List files
142 run: find dist
143 - run: chmod +x dist/fiat_crypto
144 - name: Test files (host)
145 run: |
146 echo "::group::file fiat_crypto"
147 file dist/fiat_crypto
148 echo "::endgroup::"
149 echo "::group::ldd fiat_crypto"
150 ldd dist/fiat_crypto || true
151 echo "::endgroup::"
152 etc/ci/test-run-fiat-crypto.sh dist/fiat_crypto
153 - uses: jirutka/setup-alpine@v1
154 with:
155 branch: ${{ matrix.alpine }}
156 extra-repositories: https://dl-cdn.alpinelinux.org/alpine/edge/testing
157 - name: Test files (container)
158 shell: alpine.sh {0}
159 run: etc/ci/test-run-fiat-crypto.sh dist/fiat_crypto
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 edge
172 uses: actions/download-artifact@v4
173 with:
174 name: standalone-edge
175 path: dist/
176 - name: List files
177 run: find dist
178 - name: Rename files
179 run: |
180 echo "::group::find arch"
181 arch="$(etc/ci/find-arch.sh dist/fiat_crypto "unknown")"
182 tag="$(git describe --tags HEAD)"
183 fname="Fiat-Cryptography_${tag}_Linux_${arch}"
184 echo "$fname"
185 mv dist/fiat_crypto "dist/$fname"
186 find dist
187 file "dist/$fname"
188 - name: Upload artifacts to GitHub Release
189 env:
190 GITHUB_TOKEN: ${{ github.token }}
191 # Upload to GitHub Release using the `gh` CLI.
192 # `dist/` contains the built packages
193 run: >-
194 gh release upload
195 '${{ github.ref_name }}' dist/**
196 --repo '${{ github.repository }}'
197 if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}
198
199 alpine-check-all:
200 runs-on: ubuntu-latest
201 needs: [build, test-standalone, publish-standalone]
202 if: always()
203 steps:
204 - run: echo 'build passed'
205 if: ${{ needs.build.result == 'success' }}
206 - run: echo 'test-standalone passed'
207 if: ${{ needs.test-standalone.result == 'success' }}
208 - run: echo 'publish-standalone passed'
209 if: ${{ needs.publish-standalone.result == 'success' }}
210 - run: echo 'build failed' && false
211 if: ${{ needs.build.result != 'success' }}
212 - run: echo 'test-standalone failed' && false
213 if: ${{ needs.test-standalone.result != 'success' }}
214 - run: echo 'publish-standalone failed' && false
215 if: ${{ needs.publish-standalone.result != 'success' }}