2020-03-07 06:00:10 +03:00
|
|
|
# quick build and tests (unit & func, but not doc or haddock tests),
|
|
|
|
# on linux, for noteworthy pushes to master
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 01:33:05 +03:00
|
|
|
name: push CI
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
paths:
|
2020-03-07 06:37:35 +03:00
|
|
|
- '.github/workflows/quick.yml'
|
2020-03-06 21:54:00 +03:00
|
|
|
- 'stack*'
|
|
|
|
- 'hledger-lib'
|
|
|
|
- 'hledger'
|
|
|
|
- 'hledger-ui'
|
|
|
|
- 'hledger-web'
|
2020-03-08 01:33:05 +03:00
|
|
|
- 'tests'
|
2020-03-06 21:54:00 +03:00
|
|
|
- '!**.md'
|
|
|
|
- '!**.1'
|
|
|
|
- '!**.5'
|
|
|
|
- '!**.info'
|
|
|
|
- '!**.txt'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-03-07 00:54:32 +03:00
|
|
|
runs-on: ubuntu-latest
|
2020-03-06 21:54:00 +03:00
|
|
|
steps:
|
|
|
|
|
2020-03-08 01:33:05 +03:00
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-03-06 21:54:00 +03:00
|
|
|
# cached things
|
|
|
|
|
2020-03-08 01:33:05 +03:00
|
|
|
# declare/restore cached things
|
|
|
|
|
|
|
|
- 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 01:33:05 +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 01:33:05 +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 01:33:05 +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 01:33:05 +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
|
2020-03-08 01:33:05 +03:00
|
|
|
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-stack-work
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger-lib/.stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: hledger-lib/.stack-work
|
2020-03-08 01:33:05 +03:00
|
|
|
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-hledger-lib-stack-work
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger/.stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: hledger/.stack-work
|
2020-03-08 01:33:05 +03:00
|
|
|
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-hledger-stack-work
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger-ui/.stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: hledger-ui/.stack-work
|
2020-03-08 01:33:05 +03:00
|
|
|
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-hledger-ui-stack-work
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger-web/.stack-work
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: hledger-web/.stack-work
|
2020-03-08 01:33:05 +03:00
|
|
|
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-hledger-web-stack-work
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
# actions
|
|
|
|
|
|
|
|
- name: Install stack
|
2020-03-07 00:54:32 +03:00
|
|
|
# curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C $INSTALLDIR '*/stack'
|
|
|
|
# mkdir -p ~/.local/bin
|
|
|
|
# export PATH=~/.local/bin:$PATH
|
|
|
|
# if [[ ! -x ~/.local/bin/stack ]]; then curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
|
2020-03-06 21:54:00 +03:00
|
|
|
run: |
|
|
|
|
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 --only-dependencies
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-07 00:54:32 +03:00
|
|
|
- name: Build hledger fast
|
2020-03-06 21:54:00 +03:00
|
|
|
run: |
|
2020-03-08 01:33:05 +03:00
|
|
|
stack build --fast --pedantic
|
|
|
|
# --ghc-options=-Werror
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-08 01:33:05 +03:00
|
|
|
- name: Install shelltestrunner
|
2020-03-07 00:54:32 +03:00
|
|
|
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
|
|
|
|
shelltest --version
|
2020-03-07 00:54:32 +03:00
|
|
|
|
2020-03-08 01:33:05 +03:00
|
|
|
- name: Test functional tests (excluding addons)
|
|
|
|
run: |
|
|
|
|
COLUMNS=80 stack exec -- shelltest --execdir -j16 tests -x /bin -x /addons
|