2020-03-07 00:54:32 +03:00
|
|
|
# basic build testing on mac, run nightly
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-07 00:54:32 +03:00
|
|
|
name: mac nightly CI
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
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 * * *"
|
2020-03-06 21:54:00 +03:00
|
|
|
# uncomment when testing CI:
|
|
|
|
push:
|
2020-03-07 05:31:18 +03:00
|
|
|
branches: [ ci, master ] # master too for testing
|
2020-03-06 21:54:00 +03:00
|
|
|
paths:
|
2020-03-07 06:37:35 +03:00
|
|
|
- '.github/workflows/mac-nightly.yml'
|
2020-03-06 21:54:00 +03:00
|
|
|
- 'stack*'
|
|
|
|
- 'hledger-lib'
|
|
|
|
- 'hledger'
|
|
|
|
- 'hledger-ui'
|
|
|
|
- 'hledger-web'
|
2020-03-08 01:02:21 +03:00
|
|
|
- 'tests'
|
2020-03-06 21:54:00 +03:00
|
|
|
- '!**.md'
|
|
|
|
- '!**.1'
|
|
|
|
- '!**.5'
|
|
|
|
- '!**.info'
|
|
|
|
- '!**.txt'
|
|
|
|
# pull_request:
|
|
|
|
# branches: [ master ]
|
|
|
|
# paths:
|
2020-03-08 01:02:21 +03:00
|
|
|
# - '.github/workflows/mac-nightly.yml'
|
2020-03-06 21:54:00 +03:00
|
|
|
# - 'stack*'
|
|
|
|
# - 'hledger-lib'
|
|
|
|
# - 'hledger'
|
|
|
|
# - 'hledger-ui'
|
|
|
|
# - 'hledger-web'
|
2020-03-08 01:02:21 +03:00
|
|
|
# - 'tests'
|
2020-03-06 21:54:00 +03:00
|
|
|
# - '!**.md'
|
|
|
|
# - '!**.1'
|
|
|
|
# - '!**.5'
|
|
|
|
# - '!**.info'
|
|
|
|
# - '!**.txt'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
|
2020-03-08 00:39:53 +03:00
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# declare/restore cached things
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 00:39:53 +03:00
|
|
|
- name: Cache stack global package db
|
|
|
|
id: stack-global
|
2020-03-06 21:54:00 +03:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.stack
|
2020-03-08 00:39:53 +03:00
|
|
|
key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-stack-global
|
|
|
|
${{ runner.os }}-stack
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 00:39:53 +03:00
|
|
|
- name: Cache stack-installed programs in ~/.local/bin
|
|
|
|
id: stack-programs
|
2020-03-06 21:54:00 +03:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.local/bin
|
2020-03-08 00:39:53 +03:00
|
|
|
key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-stack-programs
|
|
|
|
${{ runner.os }}-local-bin
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 00:39:53 +03:00
|
|
|
# stack's local package dbs for the project and each package
|
2020-03-06 21:54:00 +03:00
|
|
|
- name: Cache .stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: .stack-work
|
|
|
|
key: ${{ 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
|
|
|
|
|
|
|
|
- name: Cache hledger/.stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: hledger/.stack-work
|
|
|
|
key: ${{ 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
|
|
|
|
|
|
|
|
- name: Cache hledger-web/.stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: hledger-web/.stack-work
|
|
|
|
key: ${{ runner.os }}-hledger-web-stack-work
|
|
|
|
|
|
|
|
# actions
|
|
|
|
|
|
|
|
- name: Install stack
|
|
|
|
# curl --insecure -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C $INSTALLDIR
|
|
|
|
run: |
|
|
|
|
brew install haskell-stack
|
|
|
|
stack --version
|
|
|
|
|
|
|
|
- name: Install GHC
|
|
|
|
run: |
|
2020-03-08 01:33:05 +03:00
|
|
|
stack setup --install-ghc
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Install haskell deps
|
|
|
|
run: |
|
2020-03-08 01:33:05 +03:00
|
|
|
stack build --test --bench --only-dependencies
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 00:39:53 +03:00
|
|
|
- name: Build hledger and test unit tests, doc tests
|
2020-03-06 21:54:00 +03:00
|
|
|
run: |
|
2020-03-08 01:53:12 +03:00
|
|
|
stack build --test --ghc-options=-Werror
|
|
|
|
# --pedantic
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 00:39:53 +03:00
|
|
|
- name: Install shelltestrunner
|
|
|
|
run: |
|
|
|
|
export PATH=~/.local/bin:$PATH
|
2020-03-08 01:33:05 +03:00
|
|
|
if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi
|
2020-03-08 00:39:53 +03:00
|
|
|
shelltest --version
|
|
|
|
|
|
|
|
- name: Test functional tests (excluding addons)
|
|
|
|
run: |
|
2020-03-08 01:33:05 +03:00
|
|
|
COLUMNS=80 stack exec -- shelltest --execdir -j16 tests -x /bin -x /addons
|
2020-03-08 00:39:53 +03:00
|
|
|
|
2020-03-08 02:14:21 +03:00
|
|
|
|