| 1 |
name: CI (Coq, MacOS) |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master , sp2019latest , v8.6 , v8.8 , v8.10 ] |
| 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 |
|
| 21 |
include: |
| 22 |
- os: { name: 'macOS 13', arch: 'x86_64', runs-on: 'macos-13' } |
| 23 |
ocaml-compiler: '4.13.0' |
| 24 |
- os: { name: 'macOS 14', arch: 'arm64' , runs-on: 'macos-14' } |
| 25 |
ocaml-compiler: '4.14.2' |
| 26 |
|
| 27 |
runs-on: ${{ matrix.os.runs-on }} |
| 28 |
|
| 29 |
concurrency: |
| 30 |
group: ${{ github.workflow }}-${{ matrix.os.runs-on }}-${{ matrix.ocaml-compiler }}-${{ github.head_ref || github.run_id }} |
| 31 |
cancel-in-progress: true |
| 32 |
|
| 33 |
env: |
| 34 |
NJOBS: "2" |
| 35 |
COQ_VERSION: "8.20.0" |
| 36 |
COQCHKEXTRAFLAGS: "" |
| 37 |
SKIP_BEDROCK2: "0" |
| 38 |
OPAMYES: "true" |
| 39 |
OPAMCONFIRMLEVEL: "unsafe-yes" |
| 40 |
|
| 41 |
name: ${{ matrix.os.name }} (${{ matrix.os.arch }}) |
| 42 |
|
| 43 |
steps: |
| 44 |
- uses: actions/checkout@v4 |
| 45 |
with: |
| 46 |
submodules: recursive |
| 47 |
- name: Set up OCaml |
| 48 |
uses: ocaml/setup-ocaml@v3 |
| 49 |
with: |
| 50 |
ocaml-compiler: ${{ matrix.ocaml-compiler }} |
| 51 |
|
| 52 |
- name: Work around https://github.com/ocaml/opam-repository/pull/26891#issuecomment-2486598516 |
| 53 |
run: | |
| 54 |
# Alternative: brew update; brew upgrade; brew install pkgconf |
| 55 |
brew unlink pkg-config |
| 56 |
brew install pkgconf |
| 57 |
brew unlink pkgconf |
| 58 |
brew link pkg-config |
| 59 |
- name: Install system dependencies |
| 60 |
run: brew install gnu-time gnu-sed coreutils grep |
| 61 |
- run: opam update |
| 62 |
- run: opam pin add coq ${COQ_VERSION} |
| 63 |
- run: opam install js_of_ocaml |
| 64 |
- name: echo build params |
| 65 |
run: etc/ci/describe-system-config-macos.sh |
| 66 |
- name: deps |
| 67 |
run: opam exec -- etc/ci/github-actions-make.sh -j2 deps |
| 68 |
- name: all-except-js-of-ocaml |
| 69 |
run: opam exec -- etc/ci/github-actions-make.sh -j2 all-except-js-of-ocaml |
| 70 |
- name: pre-standalone-extracted |
| 71 |
run: opam exec -- etc/ci/github-actions-make.sh -j2 pre-standalone-extracted |
| 72 |
- name: all |
| 73 |
run: opam exec -- etc/ci/github-actions-make.sh -j2 all |
| 74 |
- run: find . -name "*.timing" | xargs tar -czvf timing-files.tgz |
| 75 |
if: failure() |
| 76 |
- name: upload generated timing files |
| 77 |
uses: actions/upload-artifact@v4 |
| 78 |
with: |
| 79 |
name: timing-files-${{ matrix.os.runs-on }} |
| 80 |
path: timing-files.tgz |
| 81 |
if: failure() |
| 82 |
- name: install-standalone-unified-ocaml |
| 83 |
run: opam exec -- etc/ci/github-actions-make.sh install-standalone-unified-ocaml BINDIR=dist |
| 84 |
- name: install-standalone-js-of-ocaml |
| 85 |
run: opam exec -- etc/ci/github-actions-make.sh install-standalone-js-of-ocaml |
| 86 |
- name: only-test-amd64-files-lite |
| 87 |
run: opam exec -- etc/ci/github-actions-make.sh -j2 only-test-amd64-files-lite SLOWEST_FIRST=1 |
| 88 |
|
| 89 |
- name: upload OCaml files |
| 90 |
uses: actions/upload-artifact@v4 |
| 91 |
with: |
| 92 |
name: ExtractionOCaml-${{ matrix.os.arch }} |
| 93 |
path: src/ExtractionOCaml |
| 94 |
- name: upload js_of_ocaml files |
| 95 |
uses: actions/upload-artifact@v4 |
| 96 |
with: |
| 97 |
name: ExtractionJsOfOCaml-${{ matrix.os.arch }} |
| 98 |
path: src/ExtractionJsOfOCaml |
| 99 |
- name: upload standalone files |
| 100 |
uses: actions/upload-artifact@v4 |
| 101 |
with: |
| 102 |
name: standalone-macos-${{ matrix.os.arch }} |
| 103 |
path: dist/fiat_crypto |
| 104 |
- name: upload standalone js files |
| 105 |
uses: actions/upload-artifact@v4 |
| 106 |
with: |
| 107 |
name: standalone-html-macos-${{ matrix.os.arch }} |
| 108 |
path: fiat-html |
| 109 |
- name: install |
| 110 |
run: opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml |
| 111 |
- name: install-without-bedrock2 |
| 112 |
run: opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml |
| 113 |
- name: install-dev |
| 114 |
run: opam exec -- etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml |
| 115 |
- name: display timing info |
| 116 |
run: cat time-of-build-pretty.log |
| 117 |
- name: display per-line timing info |
| 118 |
run: etc/ci/github-actions-display-per-line-timing.sh |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
combine-standalone: |
| 132 |
runs-on: macos-latest |
| 133 |
needs: build |
| 134 |
steps: |
| 135 |
- uses: actions/checkout@v4 |
| 136 |
- name: Download standalone MacOS x86_64 |
| 137 |
uses: actions/download-artifact@v4 |
| 138 |
with: |
| 139 |
name: standalone-macos-x86_64 |
| 140 |
path: dist-x86_64/ |
| 141 |
- name: Download standalone MacOS arm64 |
| 142 |
uses: actions/download-artifact@v4 |
| 143 |
with: |
| 144 |
name: standalone-macos-arm64 |
| 145 |
path: dist-arm64/ |
| 146 |
- name: Create universal binary |
| 147 |
run: | |
| 148 |
mkdir -p dist |
| 149 |
lipo -create -output dist/fiat_crypto dist-x86_64/fiat_crypto dist-arm64/fiat_crypto |
| 150 |
- name: upload universal binary |
| 151 |
uses: actions/upload-artifact@v4 |
| 152 |
with: |
| 153 |
name: standalone-macos |
| 154 |
path: dist/fiat_crypto |
| 155 |
|
| 156 |
test-standalone: |
| 157 |
strategy: |
| 158 |
fail-fast: false |
| 159 |
matrix: |
| 160 |
arch: ['', '-x86_64', '-arm64'] |
| 161 |
os: ['macos-13', 'macos-14', 'macos-latest'] |
| 162 |
exclude: |
| 163 |
- os: 'macos-13' |
| 164 |
arch: '-arm64' |
| 165 |
runs-on: ${{ matrix.os }} |
| 166 |
needs: [build, combine-standalone] |
| 167 |
steps: |
| 168 |
- uses: actions/checkout@v4 |
| 169 |
- name: Download standalone MacOS${{ matrix.arch }} |
| 170 |
uses: actions/download-artifact@v4 |
| 171 |
with: |
| 172 |
name: standalone-macos${{ matrix.arch }} |
| 173 |
path: dist/ |
| 174 |
- name: List files |
| 175 |
run: find dist |
| 176 |
- run: chmod +x dist/fiat_crypto |
| 177 |
- name: Test files (${{ matrix.arch }} on ${{ matrix.os }}) |
| 178 |
run: | |
| 179 |
echo "::group::file fiat_crypto" |
| 180 |
file dist/fiat_crypto |
| 181 |
echo "::endgroup::" |
| 182 |
echo "::group::otool -L fiat_crypto" |
| 183 |
otool -L dist/fiat_crypto |
| 184 |
echo "::endgroup::" |
| 185 |
echo "::group::lipo -info fiat_crypto" |
| 186 |
lipo -info dist/fiat_crypto |
| 187 |
echo "::endgroup::" |
| 188 |
etc/ci/test-run-fiat-crypto.sh dist/fiat_crypto |
| 189 |
|
| 190 |
publish-standalone: |
| 191 |
strategy: |
| 192 |
fail-fast: false |
| 193 |
matrix: |
| 194 |
arch: ['', '-x86_64', '-arm64'] |
| 195 |
runs-on: ubuntu-latest |
| 196 |
needs: [build, combine-standalone] |
| 197 |
permissions: |
| 198 |
contents: write |
| 199 |
steps: |
| 200 |
- uses: actions/checkout@v4 |
| 201 |
with: |
| 202 |
fetch-depth: 0 |
| 203 |
tags: true |
| 204 |
- name: Download standalone MacOS${{ matrix.arch }} |
| 205 |
uses: actions/download-artifact@v4 |
| 206 |
with: |
| 207 |
name: standalone-macos${{ matrix.arch }} |
| 208 |
path: dist/ |
| 209 |
- name: List files |
| 210 |
run: find dist |
| 211 |
- name: Rename files |
| 212 |
run: | |
| 213 |
arch="$(etc/ci/find-arch.sh dist/fiat_crypto)" |
| 214 |
tag="$(git describe --tags HEAD)" |
| 215 |
fname="Fiat-Cryptography_${tag}_macOS_${arch}" |
| 216 |
echo "$fname" |
| 217 |
mv dist/fiat_crypto "dist/$fname" |
| 218 |
find dist |
| 219 |
- name: Upload macOS-${{ matrix.arch }} artifacts to GitHub Release |
| 220 |
env: |
| 221 |
GITHUB_TOKEN: ${{ github.token }} |
| 222 |
|
| 223 |
|
| 224 |
run: >- |
| 225 |
gh release upload |
| 226 |
'${{ github.ref_name }}' dist/** |
| 227 |
--repo '${{ github.repository }}' |
| 228 |
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }} |
| 229 |
|
| 230 |
macos-check-all: |
| 231 |
runs-on: ubuntu-latest |
| 232 |
needs: [build, test-standalone, publish-standalone] |
| 233 |
if: always() |
| 234 |
steps: |
| 235 |
- run: echo 'build passed' |
| 236 |
if: ${{ needs.build.result == 'success' }} |
| 237 |
- run: echo 'test-standalone passed' |
| 238 |
if: ${{ needs.test-standalone.result == 'success' }} |
| 239 |
- run: echo 'publish-standalone passed' |
| 240 |
if: ${{ needs.publish-standalone.result == 'success' }} |
| 241 |
- run: echo 'build failed' && false |
| 242 |
if: ${{ needs.build.result != 'success' }} |
| 243 |
- run: echo 'test-standalone failed' && false |
| 244 |
if: ${{ needs.test-standalone.result != 'success' }} |
| 245 |
- run: echo 'publish-standalone failed' && false |
| 246 |
if: ${{ needs.publish-standalone.result != 'success' }} |