hledger/.github/workflows/windows-nightly.yml
2020-03-17 09:55:29 -07:00

152 lines
5.0 KiB
YAML

# basic hledger/hledger-web build testing, and binary building,
# on windows, run nightly
# Using GHC 8.8.2 to avoid "access violation" error with 8.8.3
name: windows nightly CI with GHC 8.8.2
on:
# run nightly
schedule:
- cron: "0 07 * * *"
# and on pushes to ci-windows branch
push:
branches: [ ci-windows ]
paths:
- '.github/workflows/windows-nightly.yml'
- 'stack*.yaml'
- 'hledger-lib/**'
- 'hledger/**'
- 'hledger-ui/**'
- 'hledger-web/**'
# - 'tests/**'
- '!**.md'
- '!**.1'
- '!**.5'
- '!**.info'
- '!**.txt'
jobs:
build:
runs-on: windows-latest
steps:
- name: Check out
uses: actions/checkout@v2
# declare/restore cached things
# caching doesn't work for nightly runs yet https://github.com/actions/cache/issues/63
- name: Cache stack global package db
id: stack-global-package-db
uses: actions/cache@v1
with:
path: C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }}
restore-keys: ${{ runner.os }}-appdata-roaming-stack
# - name: showStuff
# shell: bash
# run: |
# ls -lFRa /c/users/runneradmin/appdata/roaming/stack
- name: Cache stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
id: stack-programs-dir
uses: actions/cache@v1
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: showStuff
# shell: bash
# run: |
# ls -lFRa /c/users/runneradmin/appdata/local/programs/stack
# stack's local package dbs for the project and each package
- name: Cache .stack-work
uses: actions/cache@v1
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: ${{ runner.os }}-stack-work
- name: Cache hledger-lib/.stack-work
uses: actions/cache@v1
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: Cache hledger/.stack-work
uses: actions/cache@v1
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
restore-keys: ${{ runner.os }}-hledger-stack-work
- name: Cache hledger-ui/.stack-work
uses: actions/cache@v1
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: Cache hledger-web/.stack-work
uses: actions/cache@v1
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
# actions
# - name: Add stack local bin to PATH
# run: echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin"
- 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 -skL -o stack.zip http://www.stackage.org/stack/windows-x86_64
7z x stack.zip -oC:\Windows stack.exe
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 --resolver=lts-15.3 --no-terminal setup --install-ghc
# - 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 --resolver=lts-15.3 --no-terminal build --only-dependencies
- name: Build hledger executables
run: |
stack --resolver=lts-15.3 --no-terminal install --ghc-options=-Werror
# --pedantic
# run hledger-lib/hledger functional tests, skipping the ones for addons
## - export PATH=~/.local/bin:$PATH
#- COLUMNS=80 stack exec -- shelltest --execdir -j16 tests -x /bin -x /addons
- name: Zip executables
#cd `stack path --local-bin`
run: |
cd C:\Users\runneradmin\AppData\Roaming\local\bin\
7z a D:\a\hledger\hledger\hledger.zip hledger.exe hledger-web.exe
- name: Upload zip file
uses: actions/upload-artifact@v1
with:
name: hledger.zip
path: hledger.zip