-
Notifications
You must be signed in to change notification settings - Fork 50
211 lines (187 loc) · 7.25 KB
/
macos.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
# Main doc: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions
# Runners spec: https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners
# Glob expressions: https://github.com/actions/toolkit/tree/main/packages/glob
name: Macos
###############################################################################
# Schedule:
# - push on any branch whose name matches v** or master
# - any pull request
###############################################################################
on:
push:
branches:
- 2021.02
- 2021.09
- main
pull_request:
branches:
- '**'
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
platform:
description: 'Arguments for the platform script:'
required: true
default: '-extent=x -parallel=p -jobs=2 -large=e -compcert=y -set-switch=y'
###############################################################################
# Platform script options shared among all jobs
###############################################################################
env:
PLATFORM_ARGS: -extent=x -parallel=p -jobs=2 -large=e -compcert=y -set-switch=y
COQREGTESTING: y
HOMEBREW_NO_INSTALL_FROM_API:
# See https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6351357
###############################################################################
# Macos
#
# CAVEATS:
# - COQREGTESTING broken, it makes the script loop, so we install opam by hand
###############################################################################
jobs:
Macos_platform:
name: Macos
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
variant:
# Keep this in sync with the Smoke test below
- '8.19~2024.10'
- '8.18~2023.11'
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set PLATFORM
if: ${{ github.event.inputs.platform != '' }}
run: echo "PLATFORM=${{ github.event.inputs.platform }}" >> $GITHUB_ENV
- name: Cleanup, update and upgrade HomeBrew
# This is to avoid errors of these kinds:
# - ==> Downloading https://ghcr.io/v2/homebrew/core/harfbuzz/manifests/5.1.0
# Error: adwaita-icon-theme: Failed to download resource "harfbuzz_bottle_manifest"
# The downloaded GitHub Packages manifest was corrupted or modified (it is not valid JSON):
# - dyld[45184]: Library not loaded: '/usr/local/opt/libunistring/lib/libunistring.2.dylib'
# Referenced from: '/usr/local/Cellar/wget/1.21.3/bin/wget'
# Reason: tried: '/usr/local/opt/libunistring/lib/libunistring.2.dylib' (no such file),
run: |
brew cleanup
# See https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6351357
brew config
brew untap homebrew/core homebrew/cask
brew config
brew update
# Note: brew upgrade does fail regularly, but brew is anyway in a better state afterwards
brew upgrade || true
# make sure we are using homebrew python, since we install some python packages via homebrew
brew install python3
brew link --overwrite python3
ls -l $(which python3)
ls -l $(which pip3)
# create a virtual environment so that we can use pip3
# (since python 3.12 using pip3 on package manager installed python requires a virtual environment)
python3 -m venv .venv
. .venv/bin/activate
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
echo PATH=$PATH >> $GITHUB_ENV
ls -l $(which python3)
ls -l $(which pip3)
- name: Install homebrew packages required by main script
run: brew install wget
- name: Run common platform script
shell: bash
run: ./coq_platform_make.sh -packages=${{matrix.variant}} $PLATFORM_ARGS -dumplogs
- name: 'Upload opam log folder on failure'
uses: actions/upload-artifact@v4
if: failure()
with:
name: 'Opam log folder ${{matrix.variant}}'
path: /Users/runner/.opam/log/
- name: 'Upload opam build folder on failure'
uses: actions/upload-artifact@v4
if: failure()
with:
name: 'Opam build folder ${{matrix.variant}}'
path: /Users/runner/.opam/CP*${{matrix.variant}}/.opam-switch/build
- name: Install bash (needed by smoke scripts)
run: brew install bash
- name: Create smoke test kit
shell: bash
run: |
eval $(opam env)
shell_scripts/create_smoke_test_kit.sh
- name: 'Upload smoke test kit'
uses: actions/upload-artifact@v4
with:
name: 'Smoke Test Kit Macos ${{matrix.variant}}'
path: smoke-test-kit/
retention-days: 5
- name: Install findutils, coreutils and macpack (needed by DMG script)
run: |
brew install findutils
brew install coreutils
pip3 install macpack
- name: 'Build DMG installer'
uses: Wandalen/wretry.action@v3
with:
attempt_limit: 5
attempt_delay: 5000
command: |
eval $(opam env)
macos/create_installer_macos.sh
- name: 'Upload DMG script logs on failure'
uses: actions/upload-artifact@v4
if: failure()
with:
name: 'DMG script error logs ${{matrix.variant}}'
path: macos_installer/logs/
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: 'Macos installer ${{matrix.variant}} x86_64'
path: macos_installer/Coq-Platform-*.dmg
retention-days: 5
Macos_smoke:
name: Smoke test Macos
needs: Macos_platform
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
variant:
- '8.19~2024.10'
- '8.18~2023.11'
steps:
- name: Install bash
run: brew install bash
- name: 'Download Artifact'
uses: actions/download-artifact@v4
id: download
with:
name: 'Macos installer ${{matrix.variant}} x86_64'
- name: 'Download smoke test kit'
uses: actions/download-artifact@v4
id: download-smoke
with:
name: 'Smoke Test Kit Macos ${{matrix.variant}}'
- name: 'Run Installer'
shell: bash
run: |
cd ${{steps.download.outputs.download-path}}
DMG=$(ls Coq-Platform-*.dmg)
hdiutil attach $DMG
cp -r /Volumes/${DMG%%.dmg}/Coq-Platform*.app /Applications/
hdiutil detach /Volumes/${DMG%%.dmg}/
- name: 'Smoke coqc'
shell: bash
run: |
cd /Applications/Coq-Platform*.app/Contents/Resources/bin/
./coqc -v
- name: 'Run Macos smoke test kit'
shell: bash
run: |
ls /Applications/Coq-Platform*.app
export PATH="$PATH:$(cd /Applications/Coq-Platform*.app/Contents/Resources/bin/; pwd)"
export COQLIB=$(coqc -where)
cd ${{steps.download-smoke.outputs.download-path}}
chmod a+x ./run-smoke-test.sh
./run-smoke-test.sh