14
14
jobs :
15
15
build :
16
16
17
- runs-on : macOS-11
17
+ strategy :
18
+ fail-fast : false
19
+ matrix :
20
+ # macOS 11, 12, 13 are x86_64; macOS 14 is arm64
21
+ include :
22
+ - os : { name: 'macOS 11', arch: 'x86_64', runs-on: 'macos-11' } # move to macOS-12 when 11 is removed
23
+ ocaml-compiler : ' 4.11.1'
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 }}
18
28
19
29
concurrency :
20
- group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
30
+ group : ${{ github.workflow }}-${{ matrix.os.runs-on }}-${{ matrix.ocaml-compiler }}-${{ github.head_ref || github.run_id }}
21
31
cancel-in-progress : true
22
32
23
33
env :
28
38
OPAMYES : " true"
29
39
OPAMCONFIRMLEVEL : " unsafe-yes"
30
40
31
- name : macos
41
+ name : ${{ matrix.os.name }} (${{ matrix.os.arch }})
32
42
33
43
steps :
34
44
- uses : actions/checkout@v4
37
47
- name : Set up OCaml
38
48
uses : ocaml/setup-ocaml@v2
39
49
with :
40
- ocaml-compiler : 4.11.1
50
+ ocaml-compiler : ${{ matrix.ocaml-compiler }}
41
51
42
52
- name : Install system dependencies
43
53
run : brew install gnu-time gnu-sed coreutils grep
@@ -48,34 +58,41 @@ jobs:
48
58
run : etc/ci/describe-system-config-macos.sh
49
59
- name : deps
50
60
run : opam exec -- etc/ci/github-actions-make.sh -j2 deps
61
+ - name : all-except-js-of-ocaml
62
+ run : opam exec -- etc/ci/github-actions-make.sh -j2 all-except-js-of-ocaml
63
+ - name : pre-standalone-extracted
64
+ run : opam exec -- etc/ci/github-actions-make.sh -j2 pre-standalone-extracted
51
65
- name : all
52
66
run : opam exec -- etc/ci/github-actions-make.sh -j2 all
67
+ if : ${{ matrix.os.arch != 'arm64' }}
68
+ # js_of_ocaml is too heavy for M1 GH Action runners which have only 7GB RAM, cf https://github.com/ocsigen/js_of_ocaml/issues/1612, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
53
69
- name : install-standalone-unified-ocaml
54
70
run : opam exec -- etc/ci/github-actions-make.sh install-standalone-unified-ocaml BINDIR=dist
55
71
- name : install-standalone-js-of-ocaml
56
72
run : opam exec -- etc/ci/github-actions-make.sh install-standalone-js-of-ocaml
73
+ if : ${{ matrix.os.arch != 'arm64' }}
57
74
- name : only-test-amd64-files-lite
58
75
run : opam exec -- etc/ci/github-actions-make.sh -j2 only-test-amd64-files-lite SLOWEST_FIRST=1
59
76
60
77
- name : upload OCaml files
61
78
uses : actions/upload-artifact@v3
62
79
with :
63
- name : ExtractionOCaml
80
+ name : ExtractionOCaml-${{ matrix.os.arch }}
64
81
path : src/ExtractionOCaml
65
82
- name : upload js_of_ocaml files
66
83
uses : actions/upload-artifact@v3
67
84
with :
68
- name : ExtractionJsOfOCaml
85
+ name : ExtractionJsOfOCaml-${{ matrix.os.arch }}
69
86
path : src/ExtractionJsOfOCaml
70
87
- name : upload standalone files
71
88
uses : actions/upload-artifact@v3
72
89
with :
73
- name : standalone-macos
90
+ name : standalone-macos-${{ matrix.os.arch }}
74
91
path : dist/fiat_crypto
75
92
- name : upload standalone js files
76
93
uses : actions/upload-artifact@v3
77
94
with :
78
- name : standalone-html-macos
95
+ name : standalone-html-macos-${{ matrix.os.arch }}
79
96
path : fiat-html
80
97
- name : install
81
98
run : opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml
90
107
# - name: upload timing and .vo info
91
108
# uses: actions/upload-artifact@v3
92
109
# with:
93
- # name: build-outputs
110
+ # name: build-outputs-${{ matrix.os.arch }}
94
111
# path: .
95
112
# if: always ()
96
113
# - name: validate
@@ -99,20 +116,57 @@ jobs:
99
116
# make TIMED=1 validate COQCHKFLAGS="-o ${COQCHKEXTRAFLAGS}"
100
117
# if: github.event_name != 'pull_request'
101
118
102
- test -standalone :
119
+ combine -standalone :
103
120
runs-on : macos-latest
104
121
needs : build
105
122
steps :
106
123
- uses : actions/checkout@v4
107
- - name : Download standalone MacOS
124
+ - name : Download standalone MacOS x86_64
125
+ uses : actions/download-artifact@v3
126
+ with :
127
+ name : standalone-macos-x86_64
128
+ path : dist-x86_64/
129
+ - name : Download standalone MacOS arm64
108
130
uses : actions/download-artifact@v3
131
+ with :
132
+ name : standalone-macos-arm64
133
+ path : dist-arm64/
134
+ - name : Create universal binary
135
+ run : |
136
+ mkdir -p dist
137
+ lipo -create -output dist/fiat_crypto dist-x86_64/fiat_crypto dist-arm64/fiat_crypto
138
+ - name : upload universal binary
139
+ uses : actions/upload-artifact@v3
109
140
with :
110
141
name : standalone-macos
142
+ path : dist/fiat_crypto
143
+
144
+ test-standalone :
145
+ strategy :
146
+ fail-fast : false
147
+ matrix :
148
+ arch : ['', '-x86_64', '-arm64']
149
+ os : ['macos-11', 'macos-12', 'macos-13', 'macos-14', 'macos-latest']
150
+ exclude :
151
+ - os : ' macos-11'
152
+ arch : ' -arm64'
153
+ - os : ' macos-12'
154
+ arch : ' -arm64'
155
+ - os : ' macos-13'
156
+ arch : ' -arm64'
157
+ runs-on : ${{ matrix.os }}
158
+ needs : [build, combine-standalone]
159
+ steps :
160
+ - uses : actions/checkout@v4
161
+ - name : Download standalone MacOS${{ matrix.arch }}
162
+ uses : actions/download-artifact@v3
163
+ with :
164
+ name : standalone-macos${{ matrix.arch }}
111
165
path : dist/
112
166
- name : List files
113
167
run : find dist
114
168
- run : chmod +x dist/fiat_crypto
115
- - name : Test files
169
+ - name : Test files (${{ matrix.arch }} on ${{ matrix.os }})
116
170
run : |
117
171
echo "::group::file fiat_crypto"
118
172
file dist/fiat_crypto
@@ -126,19 +180,23 @@ jobs:
126
180
etc/ci/test-run-fiat-crypto.sh dist/fiat_crypto
127
181
128
182
publish-standalone :
183
+ strategy :
184
+ fail-fast : false
185
+ matrix :
186
+ arch : ['', '-x86_64', '-arm64']
129
187
runs-on : ubuntu-latest
130
- needs : build
188
+ needs : [ build, combine-standalone]
131
189
permissions :
132
190
contents : write # IMPORTANT: mandatory for making GitHub Releases
133
191
steps :
134
192
- uses : actions/checkout@v4
135
193
with :
136
194
fetch-depth : 0 # Fetch all history for all tags and branches
137
195
tags : true # Fetch all tags as well, `fetch-depth: 0` might be sufficient depending on Git version
138
- - name : Download standalone MacOS
196
+ - name : Download standalone MacOS${{ matrix.arch }}
139
197
uses : actions/download-artifact@v3
140
198
with :
141
- name : standalone-macos
199
+ name : standalone-macos${{ matrix.arch }}
142
200
path : dist/
143
201
- name : List files
144
202
run : find dist
@@ -150,7 +208,7 @@ jobs:
150
208
echo "$fname"
151
209
mv dist/fiat_crypto "dist/$fname"
152
210
find dist
153
- - name : Upload artifacts to GitHub Release
211
+ - name : Upload macOS-${{ matrix.arch }} artifacts to GitHub Release
154
212
env :
155
213
GITHUB_TOKEN : ${{ github.token }}
156
214
# Upload to GitHub Release using the `gh` CLI.
0 commit comments