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 version: 2.0
jobs: references:
build: stack_build: &stack_build
docker: docker:
- image: fpco/stack-build:lts - image: fpco/stack-build:lts
steps: steps:
- checkout - checkout
- run: - run:
name: Source digest name: Digest
command: git ls-files | xargs md5sum > digest command: |
echo -- "$STACK_ARGUMENTS" > rdigest
git ls-files | xargs md5sum > sdigest
- restore_cache: - restore_cache:
keys: keys:
- stack-{{ .Branch }}-{{ checksum "digest" }} # yamllint disable-line rule:line-length
- stack-{{ .Branch }} - stack-{{ .Branch }}-{{ checksum "rdigest" }}-{{ checksum "sdigest" }}
- stack-{{ .Branch }}-{{ checksum "rdigest" }}-
- stack-{{ .Branch }}-
- stack- - stack-
- run: - run:
name: Dependencies name: Dependencies
@ -23,7 +26,8 @@ jobs:
name: Build name: Build
command: make build command: make build
- save_cache: - save_cache:
key: stack-{{ .Branch }}-{{ checksum "digest" }} # yamllint disable-line rule:line-length
key: stack-{{ .Branch }}-{{ checksum "rdigest" }}-{{ checksum "sdigest" }}
paths: paths:
- ~/.stack - ~/.stack
- ./.stack-work - ./.stack-work
@ -33,6 +37,30 @@ jobs:
- run: - run:
name: Lint name: Lint
command: make lint command: make lint
- run:
name: Build Nightly jobs:
command: make check-nightly 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 .PHONY: setup
setup: setup:
stack setup stack setup $(STACK_ARGUMENTS)
stack build --dependencies-only --test --no-run-tests stack build $(STACK_ARGUMENTS) --dependencies-only --test --no-run-tests
stack install hlint weeder stack install $(STACK_ARGUMENTS) hlint weeder
.PHONY: build .PHONY: build
build: build:
stack build --pedantic --test --no-run-tests stack build $(STACK_ARGUMENTS) --pedantic --test --no-run-tests
.PHONY: test .PHONY: test
test: test:
stack test stack build $(STACK_ARGUMENTS) --test
.PHONY: lint .PHONY: lint
lint: lint:
hlint src test hlint src test
weeder . weeder .
.PHONY: check-nightly
check-nightly:
stack setup --resolver nightly
stack build --resolver nightly --pedantic --test