hledger/.github/workflows/binaries-windows-x64.yml

185 lines
6.3 KiB
YAML
Raw Normal View History

# Runs on any push to ci-windows, and weekly on master.
# Produces optimised windows binaries,
2022-01-05 22:01:59 +03:00
# using the default stack.yaml's GHC version.
# Currently runs no tests.
# Temporarily using nightly-2023-04-24 (ghc-9.4.4) to avoid https://gitlab.haskell.org/ghc/ghc/-/issues/23309
name: binaries-windows-x64
on:
schedule:
- cron: "0 07 * * 0" # sunday midnight pacific
push:
branches: [ binaries-windows-x64, binaries ]
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
2020-03-07 12:38:10 +03:00
- name: Check out
2023-01-27 10:54:56 +03:00
uses: actions/checkout@v3
# have to fetch everything for git describe for --version
2021-06-04 11:49:39 +03:00
with:
fetch-depth: 0
2021-06-04 11:51:17 +03:00
- name: Confirm all remaining steps should run
run: echo "CONTINUE=true" >> $GITHUB_ENV
2020-06-06 23:49:58 +03:00
# things to be cached/restored:
2020-03-07 14:35:19 +03:00
- name: Cache stack global package db
id: stack-global-package-db
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
2020-03-07 14:22:44 +03:00
with:
path: C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-appdata-roaming-stack
if: env.CONTINUE
2020-03-07 14:22:44 +03:00
2020-03-07 14:51:38 +03:00
- name: Cache stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
2020-03-07 14:35:19 +03:00
id: stack-programs-dir
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
with:
2020-03-06 22:16:13 +03:00
path: C:\Users\runneradmin\AppData\Local\Programs\stack\
2020-03-07 13:50:26 +03:00
# 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
if: env.CONTINUE
2020-03-06 22:41:27 +03:00
- name: Cache .stack-work
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work
if: env.CONTINUE
- name: Cache hledger-lib/.stack-work
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
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
if: env.CONTINUE
- name: Cache hledger/.stack-work
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-stack-work
if: env.CONTINUE
- name: Cache hledger-ui/.stack-work
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
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
if: env.CONTINUE
- name: Cache hledger-web/.stack-work
2023-01-27 10:53:51 +03:00
uses: actions/cache@v3
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
if: env.CONTINUE
2020-06-06 23:49:58 +03:00
# - name: showStuff
# run: |
# ls -lFRa /c/users/runneradmin/appdata/roaming/stack
# ls -lFRa /c/users/runneradmin/appdata/local/programs/stack
# actions:
2020-03-07 14:14:54 +03:00
# - name: Add stack local bin to PATH
# run: echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin"
2020-03-07 13:57:59 +03:00
# - 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
2020-03-07 14:40:48 +03:00
#if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# this step is needed to get stack.exe into PATH, for now
run: |
2020-10-19 08:45:25 +03:00
curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
2020-10-19 08:18:48 +03:00
7z x stack.zip stack.exe
which stack
2020-10-19 08:45:25 +03:00
stack --version
2020-10-19 08:55:42 +03:00
which ./stack
./stack --version
if: env.CONTINUE
2020-03-06 22:24:26 +03:00
- name: Install GHC
2020-03-07 14:51:38 +03:00
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
2020-03-07 14:40:48 +03:00
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
2020-03-06 22:24:26 +03:00
run: |
./stack --no-terminal setup --install-ghc --resolver nightly-2023-04-24
if: env.CONTINUE
2020-03-06 22:24:26 +03:00
# - name: Install shelltestrunner
## - export PATH=~/.local/bin:$PATH
# - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi
# - shelltest --version
- name: Install haskell deps
run: |
./stack --no-terminal build --only-dependencies --dry-run --resolver nightly-2023-04-24
./stack --no-terminal build --only-dependencies --resolver nightly-2023-04-24
if: env.CONTINUE
2021-06-29 22:53:17 +03:00
# use whichever GHC is in default stack.yaml
- name: Build all hledger modules warning free, optimised and minimised
2020-03-07 14:22:44 +03:00
run: |
./stack --no-terminal install --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --resolver nightly-2023-04-24
# --ghc-options=-split-sections doesn't work on windows, "too many sections"
2020-03-08 01:53:12 +03:00
# --pedantic
if: env.CONTINUE
# 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/baseline -x ledger-compat/regress -x ledger-compat/collected
# artifacts:
- name: Gather binaries
run: |
mkdir tmp
cd tmp
2022-01-06 20:59:40 +03:00
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe .
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe .
strip hledger.exe
strip hledger-web.exe
if: env.CONTINUE
- name: Create binaries artifact
uses: actions/upload-artifact@v3
with:
name: hledger-windows-x64
path: |
tmp/hledger.exe
tmp/hledger-web.exe
if: env.CONTINUE