From 041a9a318b76f6f16cc8b69dfb2f4f059ef28cc7 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Fri, 26 Jan 2018 09:16:13 -0500 Subject: [PATCH] Test all supported GHCs & nightly --- .circleci/config.yml | 50 ++++++++++++++++++++++++++++++++++---------- Makefile | 15 +++++-------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a92a340..50f981c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/Makefile b/Makefile index 9229a45..4e60062 100644 --- a/Makefile +++ b/Makefile @@ -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