;ci: reduced scheduled runs to weekly; build with all ghcs on linux

This commit is contained in:
Simon Michael 2020-03-17 17:17:41 -07:00
parent 2cec32cebe
commit 99dc37d0ab
4 changed files with 80 additions and 90 deletions

View File

@ -1,33 +1,17 @@
# reasonably thorough build/test/benchmark/haddock/functest testing, # linux CI tests, run "periodically", and on notable push to ci-linux,
# on linux, run nightly and also for noteworthy pull requests # and on notable pull request to master.
# Periodic runs don't use caching.
# Reasonably thorough build/test/benchmark/haddock/functest testing, with all GHC versions
# based on https://gist.github.com/mstksg/11f753d891cee5980326a8ea8c865233 name: linux / pull request CI
# docs:
# http://www.btellez.com/posts/triggering-github-actions-with-webhooks.html
# https://github.com/actions/cache
# https://github.com/actions/setup-haskell
# https://github.com/actions/upload-artifact
# https://github.com/marketplace/actions/cache
# https://github.com/marketplace/actions/checkout
# https://github.com/sdras/awesome-actions
# https://help.github.com/en/actions
# https://help.github.com/en/actions/configuring-and-managing-workflows/caching-and-storing-workflow-data
# https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm
name: linux nightly/pr CI
on: on:
# run nightly
schedule: schedule:
- cron: "0 07 * * *" - cron: "0 07 * * 0" # sunday midnight pacific
# and on pull requests to master
pull_request: pull_request:
branches: [ master ] branches: [ master ]
paths: paths:
- '.github/workflows/linux-nightly.yml' - '.github/workflows/linux.yml'
- 'stack*.yaml' - 'stack*.yaml'
- 'hledger-lib/**' - 'hledger-lib/**'
- 'hledger/**' - 'hledger/**'
@ -43,7 +27,7 @@ on:
push: push:
branches: [ ci-linux ] branches: [ ci-linux ]
paths: paths:
- '.github/workflows/linux-nightly.yml' - '.github/workflows/linux.yml'
- 'stack*' - 'stack*'
- 'hledger-lib' - 'hledger-lib'
- 'hledger' - 'hledger'
@ -60,32 +44,14 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest]
plan: plan:
# - { build: stack, resolver: "--resolver lts-9" } # ghc-8.0.2 - { key:"80", args: "--stack-yaml=stack-8.0.yaml" }
# - { build: stack, resolver: "--resolver lts-11" } # ghc-8.2.2 - { key:"82", args: "--stack-yaml=stack-8.2.yaml" }
# - { build: stack, resolver: "--resolver lts-12" } # ghc-8.4.4 - { key:"84", args: "--stack-yaml=stack-8.4.yaml" }
## - { build: stack, resolver: "--resolver lts-13" } redundant because lts-14 checks ghc-8.6 already - { key:"86", args: "--stack-yaml=stack-8.6.yaml" }
# - { build: stack, resolver: "--resolver lts-14" } # ghc-8.6.5 - { key:"88", args: "--stack-yaml=stack.yaml" }
- { build: stack, resolver: "--resolver lts-15" } # ghc-8.8.2 - { key:"810", args: "--stack-yaml=stack-8.10.yaml" }
# - { build: stack, resolver: "--resolver nightly" } runs-on: ubuntu-latest
# - { build: stack, resolver: "" }
# - { build: cabal, ghc: 8.0.2, cabal-install: "2.0" } # setup-haskell only supports cabal-install 2.0 and higher
# - { build: cabal, ghc: 8.2.2, cabal-install: "2.0" }
# - { build: cabal, ghc: 8.4.4, cabal-install: "2.2" }
# - { build: cabal, ghc: 8.6.5, cabal-install: "2.4" }
# - { build: cabal, ghc: 8.8.1, cabal-install: "2.4" } # currently not working for >= 3.0
# use this to include any dependencies from OS package managers
# include: []
# - os: macos-latest
# brew: anybrewdeps
# - os: ubuntu-latest
# apt-get: happy libblas-dev liblapack-dev
# exclude:
# - os: macos-latest
# plan:
# build: cabal
runs-on: ${{ matrix.os }}
steps: steps:
@ -93,63 +59,73 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
# declare/restore cached things # declare/restore cached things
# caching doesn't work for nightly runs yet https://github.com/actions/cache/issues/63 # caching doesn't work for scheduled runs yet https://github.com/actions/cache/issues/63
- name: Cache stack global package db - name: Cache stack global package db
id: stack-global id: stack-global
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.stack path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-stack-global-${{ matrix.plan.key }}-${{ hashFiles('**.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.key }}
${{ runner.os }}-stack-global ${{ runner.os }}-stack-global
${{ runner.os }}-stack
- name: Cache stack-installed programs in ~/.local/bin - name: Cache stack-installed programs in ~/.local/bin
id: stack-programs id: stack-programs
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.local/bin path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-stack-programs-${{ matrix.plan.key }}-${{ hashFiles('**.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-stack-programs-${{ matrix.plan.key }}
${{ runner.os }}-stack-programs ${{ runner.os }}-stack-programs
${{ runner.os }}-local-bin
# stack's local package dbs for the project and each package # stack's local package dbs for the project and each package
- name: Cache .stack-work - name: Cache .stack-work
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: .stack-work path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-stack-work-${{ matrix.plan.key }}-${{ hashFiles('**.yaml') }}
restore-keys: ${{ runner.os }}-stack-work restore-keys: |
${{ runner.os }}-stack-work-${{ matrix.plan.key }}
${{ runner.os }}-stack-work
- name: Cache hledger-lib/.stack-work - name: Cache hledger-lib/.stack-work
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: hledger-lib/.stack-work path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }} key: ${{ runner.os }}-hledger-lib-stack-work-${{ matrix.plan.key }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: ${{ runner.os }}-hledger-lib-stack-work restore-keys: |
${{ runner.os }}-hledger-lib-stack-work-${{ matrix.plan.key }}
${{ runner.os }}-hledger-lib-stack-work
- name: Cache hledger/.stack-work - name: Cache hledger/.stack-work
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: hledger/.stack-work path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }} key: ${{ runner.os }}-hledger-stack-work-${{ matrix.plan.key }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: ${{ runner.os }}-hledger-stack-work restore-keys: |
${{ runner.os }}-hledger-stack-work-${{ matrix.plan.key }}
${{ runner.os }}-hledger-stack-work
- name: Cache hledger-ui/.stack-work - name: Cache hledger-ui/.stack-work
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: hledger-ui/.stack-work path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }} key: ${{ runner.os }}-hledger-ui-stack-work-${{ matrix.plan.key }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: ${{ runner.os }}-hledger-ui-stack-work restore-keys: |
${{ runner.os }}-hledger-ui-stack-work-${{ matrix.plan.key }}
${{ runner.os }}-hledger-ui-stack-work
- name: Cache hledger-web/.stack-work - name: Cache hledger-web/.stack-work
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: hledger-web/.stack-work path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }} key: ${{ runner.os }}-hledger-web-stack-work-${{ matrix.plan.key }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: ${{ runner.os }}-hledger-web-stack-work restore-keys: |
${{ runner.os }}-hledger-web-stack-work-${{ matrix.plan.key }}
${{ runner.os }}-hledger-web-stack-work
# actions # actions
@ -165,21 +141,21 @@ jobs:
run: | run: |
stack $ARGS setup --install-ghc stack $ARGS setup --install-ghc
env: env:
ARGS: ${{ matrix.plan.resolver }} ARGS: ${{ matrix.plan.args }}
- name: Install haskell deps - name: Install haskell deps
run: | run: |
stack $ARGS build --test --bench --only-dependencies stack $ARGS build --test --bench --only-dependencies
# --no-terminal # --no-terminal
env: env:
ARGS: ${{ matrix.plan.resolver }} ARGS: ${{ matrix.plan.args }}
- name: Build hledger and test unit tests, doc tests - name: Build hledger quickly warning free, run unit tests, run doc tests
run: | run: |
stack $ARGS build --test --bench --ghc-options=-Werror stack $ARGS build --test --bench --fast --ghc-options=-Werror --no-terminal
# --pedantic --no-terminal # --no-run-benchmarks # --pedantic --no-run-benchmarks
env: env:
ARGS: ${{ matrix.plan.resolver }} ARGS: ${{ matrix.plan.args }}
- name: Install shelltestrunner - name: Install shelltestrunner
run: | run: |
@ -187,14 +163,14 @@ jobs:
if [[ ! -x ~/.local/bin/shelltest ]]; then stack $ARGS install shelltestrunner-1.9; fi if [[ ! -x ~/.local/bin/shelltest ]]; then stack $ARGS install shelltestrunner-1.9; fi
shelltest --version shelltest --version
env: env:
ARGS: ${{ matrix.plan.resolver }} ARGS: ${{ matrix.plan.args }}
- name: Test functional tests (excluding addons) - name: Test functional tests (excluding addons)
run: | run: |
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
COLUMNS=80 stack $ARGS exec -- shelltest --execdir -j16 tests -x /bin -x /addons COLUMNS=80 stack $ARGS exec -- shelltest --execdir -j16 tests -x /bin -x /addons
env: env:
ARGS: ${{ matrix.plan.resolver }} ARGS: ${{ matrix.plan.args }}
- name: Test haddock generation - name: Test haddock generation
shell: bash shell: bash
@ -203,7 +179,7 @@ jobs:
# --no-haddock-hyperlink-source is 25% faster # --no-haddock-hyperlink-source is 25% faster
# --no-print-missing-docs is 600% quieter # --no-print-missing-docs is 600% quieter
env: env:
ARGS: ${{ matrix.plan.resolver }} ARGS: ${{ matrix.plan.args }}
- name: show stuff - name: show stuff
run: | run: |
@ -215,6 +191,24 @@ jobs:
# docs:
# based on https://gist.github.com/mstksg/11f753d891cee5980326a8ea8c865233
# http://www.btellez.com/posts/triggering-github-actions-with-webhooks.html
# https://github.com/actions/cache
# https://github.com/actions/setup-haskell
# https://github.com/actions/upload-artifact
# https://github.com/marketplace/actions/cache
# https://github.com/marketplace/actions/checkout
# https://github.com/sdras/awesome-actions
# https://help.github.com/en/actions
# https://help.github.com/en/actions/configuring-and-managing-workflows/caching-and-storing-workflow-data
# https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm
# https://github.com/mxschmitt/action-tmate # https://github.com/mxschmitt/action-tmate
# - name: Setup tmate session # - name: Setup tmate session
# uses: mxschmitt/action-tmate@v1 # uses: mxschmitt/action-tmate@v1

View File

@ -1,16 +1,15 @@
# basic build testing on mac, run nightly # mac CI tests, run "periodically", and on notable push to ci-mac.
# Periodic runs don't use caching.
name: mac nightly CI name: mac CI
on: on:
# run nightly
schedule: schedule:
- cron: "0 07 * * *" - cron: "0 07 * * 0" # sunday midnight pacific
# and on pushes to ci-mac branch
push: push:
branches: [ ci-mac ] branches: [ ci-mac ]
paths: paths:
- '.github/workflows/mac-nightly.yml' - '.github/workflows/mac.yml'
- 'stack*.yaml' - 'stack*.yaml'
- 'hledger-lib/**' - 'hledger-lib/**'
- 'hledger/**' - 'hledger/**'
@ -32,7 +31,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
# declare/restore cached things # declare/restore cached things
# caching doesn't work for nightly runs yet https://github.com/actions/cache/issues/63 # caching doesn't work for scheduled runs yet https://github.com/actions/cache/issues/63
- name: Cache stack global package db - name: Cache stack global package db
id: stack-global id: stack-global

View File

@ -1,5 +1,4 @@
# quick build and tests (unit & func, but not doc or haddock tests), # quick CI tests, run on notable push to master
# on linux, for noteworthy pushes to master
name: push CI name: push CI

View File

@ -1,18 +1,16 @@
# basic hledger/hledger-web build testing, and binary building, # windows CI tests, run "periodically", and on notable push to ci-windows
# on windows, run nightly # Periodic runs don't use caching.
# Using GHC 8.8.2 to avoid "access violation" error with 8.8.3 # Using GHC 8.8.2 to avoid "access violation" error with 8.8.3
name: windows nightly CI with GHC 8.8.2 name: windows CI
on: on:
# run nightly
schedule: schedule:
- cron: "0 07 * * *" - cron: "0 07 * * 0" # sunday midnight pacific
# and on pushes to ci-windows branch
push: push:
branches: [ ci-windows ] branches: [ ci-windows ]
paths: paths:
- '.github/workflows/windows-nightly.yml' - '.github/workflows/windows.yml'
- 'stack*.yaml' - 'stack*.yaml'
- 'hledger-lib/**' - 'hledger-lib/**'
- 'hledger/**' - 'hledger/**'
@ -34,7 +32,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
# declare/restore cached things # declare/restore cached things
# caching doesn't work for nightly runs yet https://github.com/actions/cache/issues/63 # caching doesn't work for scheduled runs yet https://github.com/actions/cache/issues/63
- name: Cache stack global package db - name: Cache stack global package db
id: stack-global-package-db id: stack-global-package-db