mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-04-05 11:29:46 +02:00
Checksumming stack.yaml was a cargo-cult of interpreted languages, where "build" artifacts are uniquely determined by the dependency lock file. This approach would result in us refusing to store a new cache after changing code (as long as it was the same resolver), and forever recompiling any altered modules. Computing a digest of all git-tracked files seems like the simplest way to key compilation for now.
39 lines
852 B
YAML
39 lines
852 B
YAML
---
|
|
version: 2.0
|
|
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: fpco/stack-build:lts
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Source digest
|
|
command: git ls-files | xargs md5sum > digest
|
|
|
|
- restore_cache:
|
|
keys:
|
|
- stack-{{ .Branch }}-{{ checksum "digest" }}
|
|
- stack-{{ .Branch }}
|
|
- stack-
|
|
- run:
|
|
name: Dependencies
|
|
command: make setup
|
|
- run:
|
|
name: Build
|
|
command: make build
|
|
- save_cache:
|
|
key: stack-{{ .Branch }}-{{ checksum "digest" }}
|
|
paths:
|
|
- ~/.stack
|
|
- ./.stack-work
|
|
- run:
|
|
name: Test
|
|
command: make test
|
|
- run:
|
|
name: Lint
|
|
command: make lint
|
|
- run:
|
|
name: Build Nightly
|
|
command: make check-nightly
|