Test all supported GHCs & nightly

This commit is contained in:
patrick brisbin 2018-01-26 09:16:13 -05:00
parent 606c3d834b
commit 041a9a318b
2 changed files with 44 additions and 21 deletions

View File

@ -1,20 +1,23 @@
---
version: 2.0
jobs:
build:
references:
stack_build: &stack_build
docker:
- image: fpco/stack-build:lts
steps:
- checkout
- run:
name: Source digest
command: git ls-files | xargs md5sum > digest
name: Digest
command: |
echo -- "$STACK_ARGUMENTS" > rdigest
git ls-files | xargs md5sum > sdigest
- restore_cache:
keys:
- stack-{{ .Branch }}-{{ checksum "digest" }}
- stack-{{ .Branch }}
# yamllint disable-line rule:line-length
- stack-{{ .Branch }}-{{ checksum "rdigest" }}-{{ checksum "sdigest" }}
- stack-{{ .Branch }}-{{ checksum "rdigest" }}-
- stack-{{ .Branch }}-
- stack-
- run:
name: Dependencies
@ -23,7 +26,8 @@ jobs:
name: Build
command: make build
- save_cache:
key: stack-{{ .Branch }}-{{ checksum "digest" }}
# yamllint disable-line rule:line-length
key: stack-{{ .Branch }}-{{ checksum "rdigest" }}-{{ checksum "sdigest" }}
paths:
- ~/.stack
- ./.stack-work
@ -33,6 +37,30 @@ jobs:
- run:
name: Lint
command: make lint
- run:
name: Build Nightly
command: make check-nightly
jobs:
build_7.10.3:
<<: *stack_build
environment:
STACK_ARGUMENTS: --resolver lts-6.35
build_8.0.2:
<<: *stack_build
environment:
STACK_ARGUMENTS: --resolver lts-9.21
build_8.2.2:
<<: *stack_build
environment:
STACK_ARGUMENTS: --resolver lts-10.3
build_nightly:
<<: *stack_build
environment:
STACK_ARGUMENTS: --resolver nightly
workflows:
version: 2
builds:
jobs:
- build_7.10.3
- build_8.0.2
- build_8.2.2
- build_nightly

View File

@ -2,25 +2,20 @@ all: setup build test lint
.PHONY: setup
setup:
stack setup
stack build --dependencies-only --test --no-run-tests
stack install hlint weeder
stack setup $(STACK_ARGUMENTS)
stack build $(STACK_ARGUMENTS) --dependencies-only --test --no-run-tests
stack install $(STACK_ARGUMENTS) hlint weeder
.PHONY: build
build:
stack build --pedantic --test --no-run-tests
stack build $(STACK_ARGUMENTS) --pedantic --test --no-run-tests
.PHONY: test
test:
stack test
stack build $(STACK_ARGUMENTS) --test
.PHONY: lint
lint:
hlint src test
weeder .
.PHONY: check-nightly
check-nightly:
stack setup --resolver nightly
stack build --resolver nightly --pedantic --test