Split out test targets

It looks like,
when we switch jobs in CI the new checkout has newer timestamps
than what's in the make cache.
Rather than dealing with that anymore, we alter the targets.

We can change `test` to ensure builds are up to date.
Then we can leave the individual test targets to run whatever is there.

In CI this means we can set the workflow to run the tests separately.
This commit is contained in:
joneshf 2018-07-29 13:07:43 -07:00
parent c61934d560
commit b968bb53a4
No known key found for this signature in database
GPG Key ID: C8FFFC4E889B880E
2 changed files with 13 additions and 9 deletions

View File

@ -17,7 +17,6 @@ jobs:
- persist_to_workspace:
root: .
paths:
- .make
- dist
- save_cache:
key: v1-stack-{{ checksum "package.yaml" }}-{{ checksum "stack.yaml" }}
@ -41,7 +40,7 @@ jobs:
name: Build sdist
command: make sdist
test:
doc-test:
docker:
- image: haskell:8.2.2
steps:
@ -49,8 +48,8 @@ jobs:
- attach_workspace:
at: .
- run:
name: Test
command: make test
name: Doc test
command: make test-doc-test
workflows:
version: 2
@ -58,6 +57,6 @@ workflows:
jobs:
- compile
- sdist
- test:
- doc-test:
requires:
- compile

View File

@ -22,12 +22,13 @@ $(CABAL_FILE): package.yaml
# We can run `hpack` indirectly with little overhead.
$(STACK) $(STACK_FLAGS) build --dry-run
$(DOC_TEST): $(EMPTY)/build
$@
$(DOC_TEST):
rm -f $(EMPTY)/build
$(MAKE) $(EMPTY)/build
$(EMPTY)/build: $(EMPTY)/stack-setup README.md Setup.hs package.yaml stack.yaml src/**/*.hs test/**/*.hs | $(DIST)
$(STACK) $(STACK_FLAGS) build --no-run-tests --test
cp -R $$($(STACK) $(STACK_FLAGS) path --dist-dir)/build $(DIST)/build
cp -R $$($(STACK) $(STACK_FLAGS) path --dist-dir)/build $(DIST)
touch $@
$(EMPTY)/stack-setup: | $(EMPTY)
@ -57,7 +58,11 @@ sdist: cabal-check | $(DIST)
$(CABAL) sdist
.PHONY: test
test: $(DOC_TEST)
test: $(EMPTY)/build test-doc-test
.PHONY: test-doc-test
test-doc-test: $(DOC_TEST)
$<
.PHONY: upload-hackage
upload-hackage: sdist