hledger/.github/workflows/windows-nightly.yml

156 lines
5.0 KiB
YAML
Raw Normal View History

# basic hledger/hledger-web build testing, and binary building,
# on windows, run nightly
name: windows nightly CI
on:
2020-03-07 06:00:10 +03:00
# XXX not supported yet; build on noteworthy push to "ci" instead
2020-03-07 05:31:18 +03:00
# schedule:
# - cron: "0 23 * * *"
# uncomment when testing CI:
push:
2020-03-07 05:31:18 +03:00
branches: [ ci, master ] # master too for testing
paths:
- '.github/workflows/windows-nightly.yml'
- 'stack*'
- 'hledger-lib'
- 'hledger'
- 'hledger-ui'
- 'hledger-web'
- '!**.md'
- '!**.1'
- '!**.5'
- '!**.info'
- '!**.txt'
# pull_request:
# branches: [ master ]
# paths:
# - 'stack*'
# - 'hledger-lib'
# - 'hledger'
# - 'hledger-ui'
# - 'hledger-web'
2020-03-06 22:06:15 +03:00
# - '.github/workflows/windows*'
# - '!**.md'
# - '!**.1'
# - '!**.5'
# - '!**.info'
# - '!**.txt'
jobs:
build:
runs-on: windows-latest
steps:
2020-03-07 12:38:10 +03:00
- name: Check out
uses: actions/checkout@v2
# declare/restore cached things
2020-03-07 14:35:19 +03:00
- name: Cache stack global package db
id: stack-global-package-db
2020-03-07 14:22:44 +03:00
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
2020-03-07 14:35:19 +03:00
- name: Cache stack local programs dir
id: stack-programs-dir
uses: actions/cache@v1
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
2020-03-07 12:51:53 +03:00
key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
2020-03-07 13:05:27 +03:00
restore-keys: ${{ runner.os }}-appdata-local-programs-stack
2020-03-06 22:41:27 +03:00
2020-03-07 14:29:51 +03:00
- name: showStuff
shell: bash
run: |
#ls -lFRa /c/users/runneradmin/appdata/roaming/stack
ls -lFRa /c/users/runneradmin/appdata/local/programs/stack
2020-03-07 13:23:54 +03:00
# stack's local package dbs for the project and each package
- name: Cache .stack-work
uses: actions/cache@v1
with:
path: .stack-work
2020-03-07 13:50:26 +03:00
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
2020-03-07 13:23:54 +03:00
restore-keys: ${{ runner.os }}-stack-work
- name: Cache hledger-lib/.stack-work
uses: actions/cache@v1
with:
path: hledger-lib/.stack-work
2020-03-07 13:50:26 +03:00
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }}
2020-03-07 13:23:54 +03:00
restore-keys: ${{ runner.os }}-hledger-lib-stack-work
- name: Cache hledger/.stack-work
uses: actions/cache@v1
with:
path: hledger/.stack-work
2020-03-07 13:50:26 +03:00
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
2020-03-07 13:23:54 +03:00
restore-keys: ${{ runner.os }}-hledger-stack-work
- name: Cache hledger-ui/.stack-work
uses: actions/cache@v1
with:
path: hledger-ui/.stack-work
2020-03-07 13:50:26 +03:00
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }}
2020-03-07 13:23:54 +03:00
restore-keys: ${{ runner.os }}-hledger-ui-stack-work
- name: Cache hledger-web/.stack-work
uses: actions/cache@v1
with:
path: hledger-web/.stack-work
2020-03-07 13:50:26 +03:00
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }}
2020-03-07 13:23:54 +03:00
restore-keys: ${{ runner.os }}-hledger-web-stack-work
# 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
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: |
curl -skL -o stack.zip http://www.stackage.org/stack/windows-x86_64
7z x stack.zip -oC:\Windows stack.exe
stack --version
2020-03-06 22:24:26 +03:00
- name: Install GHC
2020-03-07 14:35:19 +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: |
2020-03-07 14:22:44 +03:00
stack --no-terminal setup --install-ghc
2020-03-06 22:24:26 +03:00
# - name: Install shelltestrunner
# - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi
# - shelltest --version
- name: Install haskell deps
2020-03-07 14:35:19 +03:00
if: steps.stack-global-package-db.outputs.cache-hit != 'true'
run: |
2020-03-07 14:22:44 +03:00
stack --no-terminal build --only-dependencies
- name: Build hledger
2020-03-07 14:22:44 +03:00
run: |
stack --no-terminal install --ghc-options=-Werror
# run hledger-lib/hledger functional tests, skipping the ones for addons
#- COLUMNS=80 stack exec -- shelltest --execdir -j16 tests -x /bin -x /addons
2020-03-07 14:40:48 +03:00
- 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