Skip to content

Commit 983226b

Browse files
committed
[ git ][ ci ] Merge prebuilt actions
2 parents 1f45d88 + e288010 commit 983226b

File tree

4 files changed

+121
-3
lines changed

4 files changed

+121
-3
lines changed

.github/workflows/test-linux.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
8181
# make a temporary directory for compresssing
8282
mkdir zip
83-
cp -r $datadir zip/
83+
cp -r $datadir zip/data
8484
cp $executable zip/
8585
8686
# compress

.github/workflows/test-mac.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
# make a temporary directory for compresssing
8080
mkdir zip
81-
cp -r $datadir zip/
81+
cp -r $datadir zip/data
8282
cp $executable zip/
8383
8484
# compress

.github/workflows/test-windows.yaml

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# modified from https://github.com/simonmichael/hledger/blob/master/.github/workflows/windows.yml
2+
3+
name: CI (Windows)
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
build:
9+
runs-on: windows-latest
10+
steps:
11+
12+
- name: 📥 Checkout repository
13+
uses: actions/checkout@v2
14+
15+
# things to be cached/restored:
16+
17+
- name: 💾 Cache stack global package db
18+
id: stack-global-package-db
19+
uses: actions/cache@v2
20+
with:
21+
path: C:\Users\runneradmin\AppData\Roaming\stack\
22+
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }}
23+
restore-keys: |
24+
${{ runner.os }}-appdata-roaming-stack
25+
- name: 💾 Cache stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
26+
id: stack-programs-dir
27+
uses: actions/cache@v2
28+
with:
29+
path: C:\Users\runneradmin\AppData\Local\Programs\stack\
30+
# which files signal a change in stack's global db ?
31+
# **.yaml includes */package.yaml and stack.yaml* (too many), and hopefully no other changing yamls
32+
key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
33+
restore-keys: |
34+
${{ runner.os }}-appdata-local-programs-stack
35+
- name: 💾 Cache .stack-work
36+
uses: actions/cache@v2
37+
with:
38+
path: .stack-work
39+
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-stack-work
42+
- name: 💾 Cache agda-language-server/.stack-work
43+
uses: actions/cache@v2
44+
with:
45+
path: agda-language-server/.stack-work
46+
key: ${{ runner.os }}-agda-language-server-stack-work-${{ hashFiles('agda-language-server/package.yaml') }}
47+
restore-keys: |
48+
${{ runner.os }}-agda-language-server-stack-work
49+
50+
# actions
51+
52+
- name: ⏬ Install stack
53+
#if: steps.stack-programs-dir.outputs.cache-hit != 'true'
54+
# this step is needed to get stack.exe into PATH, for now
55+
run: |
56+
curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
57+
7z x stack.zip stack.exe
58+
which stack
59+
stack --version
60+
which ./stack
61+
./stack --version
62+
# must avoid GHC versions broken on windows such as 8.8.3 with https://gitlab.haskell.org/ghc/ghc/issues/17926
63+
# current default stack.yaml uses GHC 8.8.4 which hopefully is ok
64+
65+
- name: ⏬ Install GHC
66+
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
67+
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
68+
run: |
69+
./stack --no-terminal setup --install-ghc
70+
71+
- name: Install the icu library
72+
run: |
73+
./stack exec -- pacman -S --noconfirm "mingw-w64-x86_64-icu"
74+
75+
- name: 📸 Build Snapshot
76+
run: |
77+
./stack build --no-terminal --only-snapshot -j1
78+
79+
- name: 🧰 Build Dependencies
80+
run: |
81+
./stack build --no-terminal --only-dependencies
82+
83+
- name: 🔨 Build and run tests
84+
run: |
85+
./stack test
86+
87+
# artifacts:
88+
89+
- name: 📦 Compress executable and data files
90+
run: |
91+
# locate the data-dir
92+
$snapshot = (stack path --snapshot-install-root)
93+
$datadir = (ls $snapshot\share *Agda-* -Recurse -Directory).FullName
94+
95+
# locate the executable
96+
$local = (stack path --local-install-root)
97+
$executable = (ls $local\bin *als.exe* -Recurse -File).FullName
98+
99+
# make a temporary directory for compresssing
100+
mkdir zip
101+
cp -r $datadir zip/data
102+
cp $executable zip/
103+
104+
# compress
105+
cd zip
106+
Compress-Archive * als-windows.zip
107+
cd ..
108+
mv zip/als-windows.zip .
109+
110+
- name: 🚢 Release Artifacts
111+
uses: softprops/action-gh-release@v1
112+
if: startsWith(github.ref, 'refs/tags/') # so that only commits with a git tag would upload artifacts
113+
with:
114+
files: als-windows.zip
115+
draft: true
116+
prerelease: true
117+
env:
118+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ packages:
1616

1717
flags:
1818
Agda:
19-
optimise-heavily: true
19+
# optimise-heavily: true
2020
enable-cluster-counting: true

0 commit comments

Comments
 (0)