-
Notifications
You must be signed in to change notification settings - Fork 314
237 lines (202 loc) · 7.06 KB
/
ci.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: CI
on:
push:
branches:
- dev
tags:
- "*"
pull_request:
types:
- opened
- synchronize
merge_group:
env:
DEFAULT_AGDA_VERSION: "2.7.0"
DEFAULT_AGDA_STDLIB_VERSION: "2.1"
DEFAULT_GHC_VERSION: "9.4.8"
DEFAULT_CABAL_VERSION: "3.10.1.0"
DEFAULT_EPUBCHECK_VERSION: "4.2.6"
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
# Use PowerShell by default
defaults:
run:
shell: pwsh
# Limit concurrent runs to one per branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: true
matrix:
include:
# Default versions
- name: "Build on Linux"
- name: "Build on macOS"
os: macOS-latest
- name: "Build on Windows"
os: windows-latest
# Older versions of Agda
- name: "Build with older Agda 2.6.4.3"
agda-version: "2.6.4.3"
agda-stdlib-version: "2.0"
# 2024-09-05:
# Version 2.0 of the standard library breaks backwards compatibility.
# Therefore, versions of Agda before 2.6.4.3 are no longer supported.
#
# - name: "Build with older Agda 2.6.4.3"
# agda-version: "2.6.4.3"
# agda-stdlib-version: "1.7.2"
# - name: "Build with older Agda 2.6.2.2"
# agda-version: "2.6.2.2"
# agda-stdlib-version: "1.7.1"
# - name: "Build with older Agda 2.6.2.1"
# agda-version: "2.6.2.1"
# agda-stdlib-version: "1.7.1"
# - name: "Build with older Agda 2.6.2"
# agda-version: "2.6.2"
# agda-stdlib-version: "1.7.1"
# - name: "Build with older Agda 2.6.1.3"
# agda-version: "2.6.1.3"
# agda-stdlib-version: "1.6"
# Newer versions of GHC
- name: "Build with newer GHC 9.8.2"
ghc-version: "9.8.2"
- name: "Build with newer GHC 9.6.6"
ghc-version: "9.6.6"
# Older versions of GHC
- name: "Build with older GHC 9.2.8"
ghc-version: "9.2.8"
- name: "Build with older GHC 9.0.2"
ghc-version: "9.0.2"
- name: "Build with older GHC 8.10.7"
ghc-version: "8.10.7"
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
continue-on-error: ${{ matrix.experimental || false }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: "true"
- name: "Setup Haskell"
uses: ./.github/actions/setup-haskell
with:
ghc-version: "${{ matrix.ghc-version || env.DEFAULT_GHC_VERSION }}"
cabal-version: "${{ env.DEFAULT_CABAL_VERSION }}"
- name: "Setup Agda"
uses: wenkokke/setup-agda@v2
with:
agda-version: "${{ matrix.agda-version || env.DEFAULT_AGDA_VERSION }}"
force-no-build: "true"
- name: "Setup Node"
uses: ./.github/actions/setup-node
- name: "Setup HTMLProofer"
if: runner.os != 'Windows'
uses: ./.github/actions/setup-htmlproofer
# depends on Gemfile
- name: "Setup EPUBCheck"
uses: ./.github/actions/setup-epubcheck
id: setup-epubcheck
with:
epubcheck-version: "${{ env.DEFAULT_EPUBCHECK_VERSION }}"
- name: "Setup Calibre"
uses: ./.github/actions/setup-calibre
- name: "Cache build"
uses: actions/cache@v4
with:
path: _cache
key: build-${{ runner.os }}-${{ secrets.BUILD_CACHE_VERSION }}
- name: "Set standard-library version"
if: matrix.agda-stdlib-version && matrix.agda-stdlib-version != env.DEFAULT_AGDA_STDLIB_VERSION
run: |
git fetch origin v${{ matrix.agda-stdlib-version }}:v${{ matrix.agda-stdlib-version }} --depth=1
git checkout v${{ matrix.agda-stdlib-version }}
working-directory: standard-library
- name: "Build"
run: make build
- name: "Test with HTML-validate"
run: make test-html-validate
- name: "Test with HTMLProofer"
if: runner.os != 'Windows'
run: make test-htmlproofer
- name: "Test with EPUBCheck"
run: make test-epubcheck
env:
EPUBCHECK: "java -jar ${{ steps.setup-epubcheck.outputs.epubcheck-jar-path }}"
- name: "Upload latest artifact"
if: always()
uses: actions/upload-artifact@v4
with:
name: "Website HEAD ${{ runner.os }} Agda-${{ matrix.agda-version || env.DEFAULT_AGDA_VERSION }} GHC-${{ matrix.ghc-version || env.DEFAULT_GHC_VERSION }}"
path: "_site"
if-no-files-found: "error"
publish:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
needs: [build]
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "true"
- name: Download latest artifact
uses: actions/download-artifact@v4
with:
name: "Website HEAD Linux Agda-${{ env.DEFAULT_AGDA_VERSION }} GHC-${{ env.DEFAULT_GHC_VERSION }}"
path: "site"
- uses: ./.github/actions/download-release
with:
plfa-version: "19.08"
path: "site"
- uses: ./.github/actions/download-release
with:
plfa-version: "20.07"
path: "site"
- uses: ./.github/actions/download-release
with:
plfa-version: "22.08"
path: "site"
- name: Publish to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: web
folder: "site"
release:
name: Publish to GitHub Releases
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
needs: [build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "true"
- name: Setup BumpVer
id: setup-bumpver
uses: ./.github/actions/setup-bumpver
- name: Get release notes
run: |
Get-Content ./web/posts/*-release-notes-${{ steps.setup-bumpver.outputs.current-version }}.md `
| Select-Object -Skip 3 `
| Out-File -FilePath ${{ github.workspace }}/release-notes-${{ steps.setup-bumpver.outputs.current-version }}.md -Encoding utf8
shell: pwsh
- name: Download latest artifact
uses: actions/download-artifact@v4
with:
name: "Website HEAD Linux Agda-${{ env.DEFAULT_AGDA_VERSION }} GHC-${{ env.DEFAULT_GHC_VERSION }}"
path: "site"
- name: Build Website.zip
run: |
Compress-Archive -Path "site/*" -DestinationPath Website.zip
shell: pwsh
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: Website.zip
body_path: ${{ github.workspace }}/release-notes-${{ steps.setup-bumpver.outputs.current-version }}.md
fail_on_unmatched_files: true