-
Notifications
You must be signed in to change notification settings - Fork 49
190 lines (160 loc) · 5.85 KB
/
ubuntu.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
# 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: Ubuntu
###############################################################################
# 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=i -compcert=y -unimath=n -set-switch=y'
snap_pick:
description: 'Package pick for the snap package:'
default: 8.17~2023.08
upload:
description: 'Upload artifact to Snap Store? (true/false, default false)'
default: false
###############################################################################
# Platform script options shared among all jobs
###############################################################################
env:
PLATFORM: -extent=x -parallel=p -jobs=2 -large=i -compcert=y -unimath=n -set-switch=y
COQREGTESTING: y
SNAP_PICK: 8.17~2023.08
###############################################################################
# Ubuntu
#
# CAVEATS:
# - you need bubblewrap or the script fails
# - build-essential pulls in the C toolchain
###############################################################################
jobs:
Ubuntu_platform:
name: Ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant:
# This should contain all picks introduced in the current release + all original picks of all Coq versions
- '8.17~2023.08'
- '8.16~2022.09'
- '8.15~2022.09'
- '8.15~2022.04'
- '8.14~2022.01'
- '8.13~2021.02'
- '8.12'
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set PLATFORM
if: ${{ github.event.inputs.platform != '' }}
run: echo "PLATFORM=${{ github.event.inputs.platform }}" >> $GITHUB_ENV
- name: Install bubblewrap and build-essential
run: |
sudo apt-get update
sudo apt-get install bubblewrap build-essential
- name: Run common platform script
shell: bash
run: ./coq_platform_make.sh -packages=${{matrix.variant}} $PLATFORM -dumplogs
- name: Create smoke test kit
shell: bash
run: |
eval $(opam env)
shell_scripts/create_smoke_test_kit.sh
- name: 'Run Linux smoke test kit'
shell: bash
run: |
eval $(opam env)
smoke-test-kit/run-smoke-test.sh
- name: 'Upload smoke test kit'
uses: actions/upload-artifact@v2
with:
name: 'Smoke Test Kit ${{matrix.variant}}'
path: smoke-test-kit
retention-days: 5
Ubuntu_snap:
name: Snap package
# Since we build the snap with --destructive-mode, the runner version must match the snap core version
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set PLATFORM
if: ${{ github.event.inputs.platform != '' }}
run: echo "PLATFORM=${{ github.event.inputs.platform }}" >> $GITHUB_ENV
- name: Set SNAP_PICK
if: ${{ github.event.inputs.snap_pick != '' }}
run: echo "SNAP_PICK=${{ github.event.inputs.snap_pick }}" >> $GITHUB_ENV
- name: Generate snapcraft file
run: linux/create_snapcraft_yaml.sh -packages=$SNAP_PICK $PLATFORM
- name: Print snapcraft file
run: cat snap/snapcraft.yaml
- name: Run snapcraft
uses: MSoegtropIMC/[email protected]
id: build
- name: Dump snapcraft logs
if: ${{ always() }}
run: cat /home/runner/.local/state/snapcraft/log/*
- name: Save Artifact
uses: actions/upload-artifact@v2
with:
name: 'Snap package'
path: ${{ steps.build.outputs.snap }}
- name: Upload Artifact to the Snap Store
if: ${{ github.event.inputs.upload }}
uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: edge
# We run this one always because the Ubuntu_platform job
# has a matrix and contains the flaky dev job
# but here we really only need the SNAP_PICK one
#
# In any case the job will fail fast if it can't download
# the snap or the smoke test
Ubuntu_smoke:
name: Snap package smoke test
if: ${{ always() }}
needs: [Ubuntu_platform, Ubuntu_snap]
runs-on: ubuntu-latest
steps:
- name: Set SNAP_PICK
if: ${{ github.event.inputs.snap_pick != '' }}
run: echo "SNAP_PICK=${{ github.event.inputs.snap_pick }}" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v2
id: download-snap
with:
name: 'Snap package'
- name: 'Download smoke test kit'
uses: actions/download-artifact@v2
id: download-smoke
with:
name: 'Smoke Test Kit ${{ env.SNAP_PICK }}'
- name: 'Install Snap'
run: |
sudo snap install --dangerous ${{ steps.download-snap.outputs.download-path }}/coq-prover_*.snap
sudo snap alias coq-prover.coqc coqc
- name: 'Run Smoke Test Kit'
run: |
cd ${{steps.download-smoke.outputs.download-path}}
chmod a+x ./run-smoke-test.sh
./run-smoke-test.sh