hledger/.github/workflows/mac.yml

175 lines
5.3 KiB
YAML
Raw Normal View History

# Runs on notable pushes to ci-mac, and weekly on master.
# Builds all modules optimised and runs unit/doc/functional tests on mac,
# using GHC 8.6,
# and uploads a binaries artifact.
name: mac CI
on:
schedule:
- cron: "0 07 * * 0" # sunday midnight pacific
2020-06-07 19:37:53 +03:00
push:
branches: [ ci-mac ]
paths:
- '.github/workflows/mac.yml'
2020-03-12 18:15:32 +03:00
- 'stack*.yaml'
- 'hledger-lib/**'
- 'hledger/**'
- 'hledger-ui/**'
- 'hledger-web/**'
- 'hledger/test/**'
- '!**.m4'
- '!**.md'
- '!**.1'
- '!**.5'
- '!**.info'
- '!**.txt'
jobs:
build:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
plan:
2020-07-11 19:17:43 +03:00
# - { ghc: "80" , stack: "stack --stack-yaml=stack8.0.yaml" }
# - { ghc: "82" , stack: "stack --stack-yaml=stack8.2.yaml" }
# - { ghc: "84" , stack: "stack --stack-yaml=stack8.4.yaml" }
# - { ghc: "86" , stack: "stack --stack-yaml=stack8.6.yaml" }
# - { ghc: "88" , stack: "stack --stack-yaml=stack.yaml" }
- { ghc: "810" , stack: "stack --stack-yaml=stack8.10.yaml" }
steps:
- name: Check out
uses: actions/checkout@v2
2020-06-06 23:49:58 +03:00
# things to be cached/restored:
- name: Cache stack global package db
id: stack-global
uses: actions/cache@v2
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-after20200902-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-after20200902
- name: Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v2
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs
- name: Cache .stack-work
uses: actions/cache@v2
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@v2
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@v2
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@v2
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@v2
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
2020-06-06 23:49:58 +03:00
# actions:
- name: Install stack
# run: |
# brew install haskell-stack
# $stack --version
run: |
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
# brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
2020-10-19 08:23:37 +03:00
stack --version
- name: Install GHC
env:
2020-07-11 19:17:43 +03:00
stack: ${{ matrix.plan.stack }}
run: |
$stack setup --install-ghc
- name: Install haskell deps
env:
2020-07-11 19:17:43 +03:00
stack: ${{ matrix.plan.stack }}
run: |
$stack build --test --only-dependencies
- name: Build hledger and test unit tests, doc tests
env:
2020-07-11 19:17:43 +03:00
stack: ${{ matrix.plan.stack }}
run: |
$stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
# --ghc-options=-split-sections doesn't work on mac
# --pedantic
- name: Install shelltestrunner
2020-07-11 19:17:43 +03:00
env:
stack: ${{ matrix.plan.stack }}
run: |
export PATH=~/.local/bin:$PATH
2020-07-11 19:17:43 +03:00
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.9; fi
shelltest --version
- name: Test functional tests (excluding addons)
2020-07-11 19:17:43 +03:00
env:
stack: ${{ matrix.plan.stack }}
run: |
export PATH=~/.local/bin:$PATH
2020-11-13 21:23:47 +03:00
COLUMNS=80 $stack exec -- shelltest --execdir -j16 tests -x /_ -x /bin -x /addons
# artifacts:
- name: Gather executables
run: |
mkdir tmp
cd tmp
mkdir hledger
cd hledger
cp ~/.local/bin/hledger .
cp ~/.local/bin/hledger-ui .
cp ~/.local/bin/hledger-web .
# XXX intermittent upload failures
- name: Upload executables artifact
uses: actions/upload-artifact@v2
with:
name: hledger-macos
path: tmp/hledger