-
-
Notifications
You must be signed in to change notification settings - Fork 321
165 lines (141 loc) · 5.85 KB
/
binaries-windows-x64.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
# Runs on any push to binaries-windows-x64 or binaries.
# Produces optimised windows binaries,
# using the default stack.yaml's GHC version.
# Currently runs no tests.
name: binaries-windows-x64
on:
push:
branches: [ binaries-windows-x64, binaries ]
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
# things to be cached/restored:
- name: process cache of stack global package db
id: stack-global-package-db
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-appdata-roaming-stack
- name: process cache of stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
id: stack-programs-dir
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\Programs\stack\
# which files signal a change in stack's global db ?
# **.yaml includes */package.yaml and stack.yaml* (too many), and hopefully no other changing yamls
key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-appdata-local-programs-stack
- name: process cache of .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work
- name: process cache of hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-lib-stack-work
- name: process cache of hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-stack-work
- name: process cache of hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-ui-stack-work
- name: process cache of hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-web-stack-work
# - name: showStuff
# run: |
# ls -lFRa /c/users/runneradmin/appdata/roaming/stack
# ls -lFRa /c/users/runneradmin/appdata/local/programs/stack
# actions:
# - name: Add stack local bin to PATH
# run: echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin"
# - name: Install stack
# run: |
# mkdir -p ~/.local/bin
# export PATH=~/.local/bin:$PATH
# if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
# $stack --version
# env:
# stack: ${{ matrix.plan.stack }}
- name: Install stack
#if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# this step is needed to get stack.exe into PATH, for now
run: |
curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
7z x stack.zip stack.exe
which stack
printf "stack: "; stack --version
which ./stack
printf "./stack: "; ./stack --version
- name: Install GHC
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
run: |
./stack --no-terminal setup --install-ghc
# - name: Install shelltestrunner
## - export PATH=~/.local/bin:$PATH
# - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.10; fi
# - shelltest --version
- name: Install haskell deps
run: |
./stack --no-terminal build --only-dependencies --dry-run
./stack --no-terminal build --only-dependencies
# use whichever GHC is in default stack.yaml
- name: Build all hledger modules warning free, optimised and minimised
run: |
./stack --no-terminal install --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
# --ghc-options=-split-sections doesn't work on windows, "too many sections"
# --pedantic
# run hledger-lib/hledger functional tests, skipping the ones for addons
## - export PATH=~/.local/bin:$PATH
#- COLUMNS=80 stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected
# artifacts:
- name: Gather binaries
run: |
mkdir tmp
cd tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe .
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-ui.exe .
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe .
strip hledger.exe
strip hledger-ui.exe
strip hledger-web.exe
- name: Create binaries artifact
uses: actions/upload-artifact@v4
with:
name: hledger-windows-x64
path: |
tmp/hledger.exe
tmp/hledger-ui.exe
tmp/hledger-web.exe