Skip to content

Commit 8199e02

Browse files
committed
[ ci ] Unify the CI workflow for testing on all platforms
1 parent bb5d5e5 commit 8199e02

File tree

2 files changed

+51
-26
lines changed

2 files changed

+51
-26
lines changed

.github/workflows/test-unix.yaml renamed to .github/workflows/test.yaml

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# modified from https://github.com/simonmichael/hledger/blob/master/.github/workflows/linux.yml
22

3-
name: CI (Unix)
3+
name: CI
44

55
defaults:
66
run:
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
22-
os: [ubuntu-latest, macos-latest]
22+
os: [ubuntu-latest, macos-latest, windows-latest]
2323
fail-fast: false
2424
steps:
2525

@@ -78,13 +78,10 @@ jobs:
7878
run: |
7979
echo PKG_CONFIG_PATH="$(brew --prefix)/opt/icu4c/lib/pkgconfig" >> "${GITHUB_ENV}"
8080
81-
# - name: ⏬ Setup Haskell
82-
# uses: haskell-actions/setup@v2
83-
# id: setup-haskell
84-
# with:
85-
# ghc-version: ${{ env.GHC_VERSION }}
86-
# enable-stack: true
87-
# stack-version: 'latest'
81+
- name: Install the icu library (on Windows)
82+
if: runner.os == 'Windows'
83+
run: |
84+
stack exec -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf
8885
8986
- name: 📸 Build Snapshot
9087
run: stack build --no-terminal --only-snapshot -j1
@@ -95,13 +92,6 @@ jobs:
9592
- name: 🧰 Build ALS
9693
run: stack build
9794

98-
99-
# - name: 🔨 Build
100-
# run: stack build
101-
102-
# - name: 🧪 Run tests
103-
# run: stack test
104-
10595
# things to be cached
10696

10797
- name: 💾 Cache stack global package db
@@ -119,7 +109,7 @@ jobs:
119109
key: ${{ steps.stack-work.outputs.cache-primary-key }}
120110

121111

122-
- name: 🔗 Bundle ICU4C DLLs (on macOS)
112+
- name: 📦 Bundle executable, DLLs and data files (on macOS)
123113
if: runner.os == 'macOS'
124114
run: | # Bundle icu4c DLLs
125115
@@ -209,8 +199,8 @@ jobs:
209199
echo " old path : $icudata_path"
210200
echo " new path : $icudata_path_new"
211201
212-
213-
- name: 📦 Compress files
202+
- name: 📦 Bundle executable, DLLs and data files (on Linux and macOS)
203+
if: runner.os != 'Windows'
214204
id: zip
215205
run: |
216206
# locate the data-dir
@@ -243,18 +233,53 @@ jobs:
243233
mv zip/als-macos.zip .
244234
fi
245235
236+
- name: 📦 Bundle executable, DLLs and data files (on Windows)
237+
if: runner.os == 'Windows'
238+
shell: pwsh
239+
run: |
240+
# locate the data-dir
241+
$snapshot = (stack path --snapshot-install-root)
242+
$datadir = (ls $snapshot\share *Agda-* -Recurse -Directory).FullName
243+
244+
# locate the executable
245+
$local = (stack path --local-install-root)
246+
$executable = (ls $local\bin *als.exe* -Recurse -File).FullName
247+
248+
# make a temporary directory for compresssing
249+
mkdir zip
250+
cp -r $datadir zip/data
251+
cp $executable zip/
252+
253+
# include text-icu DLLs
254+
$mingw64bin = (stack path --extra-library-dirs).split(", ") -match "\\bin"
255+
ls $mingw64bin
256+
cp (ls $mingw64bin *libicudt*) zip/
257+
cp (ls $mingw64bin *libicuin*) zip/
258+
cp (ls $mingw64bin *libicuuc*) zip/
259+
ls zip
260+
261+
# compress
262+
cd zip
263+
Compress-Archive * als-windows.zip
264+
cd ..
265+
mv zip/als-windows.zip .
266+
267+
246268
- name: 🧪 Run tests
247269
run: stack test --ta --als-path=zip/als
248270

249-
# - name: 🔨 Build and run tests
250-
# run: |
251-
252-
# stack test --ta --als-path=zip/als
253-
254271
# release (optional)
255272
- name: 🚢 Release Artifacts
256273
if: startsWith(github.ref, 'refs/tags/v') # so that only commits with a git tag would upload artifacts
257274
env:
258275
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
259276
run: |
260-
gh release upload ${{ github.ref_name }} als-ubuntu.zip --clobber
277+
if [[ ${{ runner.os }} == "Linux" ]]; then
278+
gh release upload ${{ github.ref_name }} als-ubuntu.zip --clobber
279+
fi
280+
if [[ ${{ runner.os }} == "macOS" ]]; then
281+
gh release upload ${{ github.ref_name }} als-macos.zip --clobber
282+
fi
283+
if [[ ${{ runner.os }} == "Windows" ]]; then
284+
gh release upload ${{ github.ref_name }} als-windows.zip --clobber
285+
fi

test/Test/LSP.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tests alsPath =
2121

2222
demo :: FilePath -> IO ()
2323
demo alsPath =
24-
runSession alsPath fullLatestClientCaps "test/data/" $ do
24+
runSession "/Users/banacorn/Downloads/als-macos/als" fullLatestClientCaps "test/data/" $ do
2525
doc <- openDoc "A.agda" "agda"
2626

2727
-- Use your favourite favourite combinators.

0 commit comments

Comments
 (0)