Skip to content

Commit 6703ff5

Browse files
committed
[ ci ] Target both Agda-2.6.4.3 and Agda-2.7.0.1
1 parent a9d8bae commit 6703ff5

File tree

2 files changed

+83
-58
lines changed

2 files changed

+83
-58
lines changed

.github/workflows/test.yaml

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,43 @@ jobs:
2020
strategy:
2121
matrix:
2222
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
23+
agda: ['2.7.0.1', '2.6.4.3']
2324
fail-fast: false
2425
steps:
2526

2627
- name: 📥 Checkout repository
2728
uses: actions/checkout@v4
2829

29-
- name: 🏗 Install yq (Windows)
30+
- name: 📤 Install yq (Windows)
3031
if: runner.os == 'Windows'
3132
uses: frenck/action-setup-yq@v1
3233

33-
- name: 🔍 Determine Stack resolver & GHC version
34+
- name: 🎛️ Determine which version of Agda to target
3435
run: |
35-
STACK_RESOLVER=$(yq .resolver stack.yaml)
36-
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
36+
STACK_YAML=$(echo stack-9.2-Agda-${{ matrix.agda }}.yaml)
37+
STACK_YAML_ARG="--stack-yaml $(echo stack-9.2-Agda-${{ matrix.agda }}.yaml)"
38+
39+
if [[ ${{ matrix.os }} == "ubuntu-latest" ]]; then
40+
ARTEFACT="als-Agda-${{ matrix.agda }}-ubuntu"
41+
fi
42+
if [[ ${{ matrix.os }} == "macos-latest" ]]; then
43+
ARTEFACT="als-Agda-${{ matrix.agda }}-macos-arm64"
44+
fi
45+
if [[ ${{ matrix.os }} == "macos-13" ]]; then
46+
ARTEFACT="als-Agda-${{ matrix.agda }}-macos-x64"
47+
fi
48+
if [[ ${{ matrix.os }} == "windows-latest" ]]; then
49+
ARTEFACT="als-Agda-${{ matrix.agda }}-windows"
50+
fi
51+
52+
echo STACK_YAML_ARG="${STACK_YAML_ARG}" >> "${GITHUB_ENV}"
53+
echo STACK_YAML="${STACK_YAML}" >> "${GITHUB_ENV}"
54+
echo ARTE="${ARTEFACT}" >> "${GITHUB_ENV}"
55+
56+
- name: 🎛️ Determine Stack resolver & GHC version
57+
run: |
58+
STACK_RESOLVER=$(yq .resolver $STACK_YAML)
59+
GHC_VERSION=$(echo $(yq .compiler $STACK_YAML) | cut -c 5-)
3760
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
3861
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
3962
@@ -46,11 +69,20 @@ jobs:
4669
enable-stack: true
4770
stack-version: 'latest'
4871

49-
- name: 🔍 Determine Stack root
72+
- name: 🎛️ Determine Stack root
5073
run: |
51-
STACK_ROOT="$(stack path --stack-root)"
74+
STACK_ROOT="$(stack path $STACK_YAML_ARG --stack-root)"
5275
echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
5376
77+
- name: 🔍 Review all variables
78+
run: |
79+
echo "STACK_YAML = ${STACK_YAML}"
80+
echo "STACK_YAML_ARG = ${STACK_YAML_ARG}"
81+
echo "STACK_RESOLVER = ${STACK_RESOLVER}"
82+
echo "ARTEFACT = ${ARTEFACT}"
83+
echo "GHC_VERSION = ${GHC_VERSION}"
84+
echo "STACK_ROOT = ${STACK_ROOT}"
85+
5486
# things to be restored:
5587
# Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers.
5688

@@ -73,27 +105,27 @@ jobs:
73105
${{ matrix.os }}-stack-resolver-${{ env.STACK_RESOLVER }}-work
74106
75107
# actions:
76-
- name: Set PKG_CONFIG_PATH for the ICU library (on macOS)
108+
- name: ⚙️ Set PKG_CONFIG_PATH for the ICU library (on macOS)
77109
if: runner.os == 'macOS'
78110
run: |
79111
echo PKG_CONFIG_PATH="$(brew --prefix)/opt/icu4c/lib/pkgconfig" >> "${GITHUB_ENV}"
80112
81-
- name: Install the icu library (on Windows)
113+
- name: 📥 Install the icu library (on Windows)
82114
if: runner.os == 'Windows'
83115
run: |
84-
stack exec -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf
116+
stack exec $STACK_YAML_ARG -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf
85117
86118
- name: 📸 Build Snapshot
87-
run: stack build --no-terminal --only-snapshot -j1
119+
run: stack build $STACK_YAML_ARG --no-terminal --only-snapshot -j1
88120

89-
- name: 🧰 Build Dependencies
90-
run: stack build --no-terminal --only-dependencies
121+
- name: 🏗️ Build Dependencies
122+
run: stack build $STACK_YAML_ARG --no-terminal --only-dependencies
91123

92-
- name: 🧰 Build ALS
93-
run: stack build
124+
- name: 🏗️ Build ALS
125+
run: stack build $STACK_YAML_ARG
94126

95-
- name: 🧰 Build Testings
96-
run: stack build --test --no-terminal --only-dependencies
127+
- name: 🏗️ Build Testings
128+
run: stack build $STACK_YAML_ARG --test --no-terminal --only-dependencies
97129

98130
# things to be cached
99131

@@ -128,7 +160,7 @@ jobs:
128160
echo "dylib_dir: $dylib_dir"
129161
130162
# find the path of "als"
131-
executable=$(find "$(stack path --local-install-root)"/bin -name "als")
163+
executable=$(find "$(stack path $STACK_YAML_ARG --local-install-root)"/bin -name "als")
132164
echo "executable: $executable"
133165
134166
# remove the old dylib, and make a new one
@@ -207,11 +239,11 @@ jobs:
207239
id: zip
208240
run: |
209241
# locate the data-dir
210-
datadir=$(find "$(stack path --snapshot-install-root)/share" -type d -name "Agda-*")
242+
datadir=$(find "$(stack path $STACK_YAML_ARG --snapshot-install-root)/share" -type d -name "Agda-*")
211243
echo "datadir: $datadir"
212244
213245
# locate the executable
214-
executable=$(find "$(stack path --local-install-root)/bin" -name "als")
246+
executable=$(find "$(stack path $STACK_YAML_ARG --local-install-root)/bin" -name "als")
215247
echo "executable: $executable"
216248
217249
# make a temporary directory for compresssing
@@ -223,35 +255,22 @@ jobs:
223255
cp "$executable" zip/
224256
225257
# compress
226-
if [[ ${{ runner.os }} == "Linux" ]]; then
227-
cd zip
228-
zip -r als-ubuntu.zip ./*
229-
cd ..
230-
mv zip/als-ubuntu.zip .
231-
fi
232-
if [[ ${{ matrix.os }} == "macos-latest" ]]; then
233-
cd zip
234-
zip -r als-macos-arm64.zip ./*
235-
cd ..
236-
mv zip/als-macos-arm64.zip .
237-
fi
238-
if [[ ${{ matrix.os }} == "macos-13" ]]; then
239-
cd zip
240-
zip -r als-macos-x64.zip ./*
241-
cd ..
242-
mv zip/als-macos-x64.zip .
243-
fi
258+
cd zip
259+
zip -r $ARTEFACT.zip ./*
260+
cd ..
261+
mv zip/$ARTEFACT.zip .
262+
244263
245264
- name: 📦 Bundle executable, DLLs and data files (on Windows)
246265
if: runner.os == 'Windows'
247266
shell: pwsh
248267
run: |
249268
# locate the data-dir
250-
$snapshot = (stack path --snapshot-install-root)
269+
$snapshot = (stack path $STACK_YAML_ARG --snapshot-install-root)
251270
$datadir = (ls $snapshot\share *Agda-* -Recurse -Directory).FullName
252271
253272
# locate the executable
254-
$local = (stack path --local-install-root)
273+
$local = (stack path $STACK_YAML_ARG --local-install-root)
255274
$executable = (ls $local\bin *als.exe* -Recurse -File).FullName
256275
257276
# make a temporary directory for compresssing
@@ -260,7 +279,7 @@ jobs:
260279
cp $executable zip/
261280
262281
# include text-icu DLLs
263-
$mingw64bin = (stack path --extra-library-dirs).split(", ") -match "\\bin"
282+
$mingw64bin = (stack path $STACK_YAML_ARG --extra-library-dirs).split(", ") -match "\\bin"
264283
ls $mingw64bin
265284
cp (ls $mingw64bin *libicudt*) zip/
266285
cp (ls $mingw64bin *libicuin*) zip/
@@ -269,31 +288,17 @@ jobs:
269288
270289
# compress
271290
cd zip
272-
Compress-Archive * als-windows.zip
291+
Compress-Archive * $ARTEFACT.zip
273292
cd ..
274-
mv zip/als-windows.zip .
293+
mv zip/$ARTEFACT.zip .
275294
276295

277296
- name: 🧪 Run tests
278-
run: stack test --ta --als-path=zip/als
297+
run: stack test $STACK_YAML_ARG --ta --als-path=zip/als
279298

280299
# release (optional)
281300
- name: 🚢 Release Artifacts
282301
if: startsWith(github.ref, 'refs/tags/v') # so that only commits with a git tag would upload artifacts
283302
env:
284303
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
285-
run: |
286-
if [[ ${{ matrix.os }} == "ubuntu-latest" ]]; then
287-
gh release upload ${{ github.ref_name }} als-ubuntu.zip --clobber
288-
fi
289-
# arm64 macos
290-
if [[ ${{ matrix.os }} == "macos-latest" ]]; then
291-
gh release upload ${{ github.ref_name }} als-macos-arm64.zip --clobber
292-
fi
293-
# x64 macos
294-
if [[ ${{ matrix.os }} == "macos-13" ]]; then
295-
gh release upload ${{ github.ref_name }} als-macos-x64.zip --clobber
296-
fi
297-
if [[ ${{ matrix.os }} == "windows-latest" ]]; then
298-
gh release upload ${{ github.ref_name }} als-windows.zip --clobber
299-
fi
304+
run: gh release upload ${{ github.ref_name }} $ARTEFACT.zip --clobber

stack-9.2-Agda-2.7.0.1.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resolver: lts-20.26
2+
compiler: ghc-9.2.8
3+
# Allow a newer minor version of GHC than the snapshot specifies
4+
compiler-check: newer-minor
5+
6+
packages:
7+
- .
8+
9+
extra-deps:
10+
- Agda-2.7.0.1
11+
- lsp-2.7.0.0@sha256:2a64b40a69fd9638056ca552d5660203019473061cff1d09dccc0c94e40a275c,3834
12+
- lsp-types-2.3.0.0@sha256:ca17a686bda5dc7ff04105ca7081dce5a90bcd050c8800a13efd68b7f0901f1c,34215
13+
- lsp-test-0.17.1.0@sha256:f54757a564b46783cf67b13f4cb4ebc45e43f5afc3604d9757ee387c091b73e9,4406
14+
- mod-0.2.0.1@sha256:eeb316fef3a8c12f4e83bbeeea748e74d75fca54d4498d574ace92e464adb05a,2409
15+
- row-types-1.0.1.2@sha256:4d4c7cb95d06a32b28ba977852d52a26b4c1f695ef083a6fd874ab6d79933b64,3071
16+
17+
flags:
18+
Agda:
19+
# optimise-heavily: true
20+
enable-cluster-counting: true

0 commit comments

Comments
 (0)