chore(gitlab-ci): more precise caching

This commit is contained in:
Gregor Kleen 2021-05-07 12:22:04 +02:00
parent f0074c8ac8
commit d71aa7d2de

View File

@ -7,14 +7,6 @@ workflow:
default:
image:
name: fpco/stack-build:lts-16.31
cache: &global_cache
key: default
paths:
- .npm
- node_modules
- .stack
- .stack-work
- .well-known-cache
variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
@ -43,6 +35,13 @@ stages:
# - deploy
npm install:
cache:
- &npm-cache
key: default-npm
paths:
- .npm
- node_modules
stage: setup
script:
- ./.npmrc.gup
@ -69,6 +68,12 @@ npm install:
interruptible: true
frontend:build:
cache:
- &frontend-cache
key: default-frontend
paths:
- .well-known-cache
stage: frontend:build
script:
- npm run frontend:build
@ -98,6 +103,13 @@ frontend:lint:
interruptible: true
yesod:build:dev:
cache:
- &stack-dev-cache
key: default-stack-dev
paths:
- .stack
- .stack-work
stage: yesod:build
script:
- stack build --test --copy-bins --local-bin-path $(pwd)/bin --fast --flag uniworx:-library-only --flag uniworx:dev --flag uniworx:pedantic --no-strip --no-run-tests
@ -136,6 +148,13 @@ yesod:build:dev:
interruptible: true
yesod:build:
cache:
- &stack-cache
key: default-stack
paths:
- .stack
- .stack-work
stage: yesod:build
script:
- stack build --test --copy-bins --local-bin-path $(pwd)/bin --flag uniworx:-library-only --flag uniworx:-dev --flag uniworx:pedantic --no-strip --no-run-tests
@ -165,8 +184,11 @@ yesod:build:
yesod:build:profile:
cache:
<<: *global_cache
policy: pull
- &stack-profile-cache
key: default-stack-profile
paths:
- .stack
- .stack-work
stage: yesod:build
script:
@ -195,7 +217,6 @@ yesod:build:profile:
yesod:test:yesod:
stage: test
cache: {}
services: &test-services
- name: postgres:10.10
@ -224,7 +245,6 @@ yesod:test:yesod:
yesod:test:yesod:dev:
stage: test
cache: {}
services: *test-services
@ -321,9 +341,6 @@ yesod:test:hlint:dev:
interruptible: true
frontend:test:
cache:
<<: *global_cache
policy: pull
stage: test
script:
- npm run frontend:test
@ -344,7 +361,6 @@ frontend:test:
interruptible: true
parse-changelog:
cache: {}
stage: prepare release
needs:
- job: npm install
@ -373,7 +389,6 @@ parse-changelog:
interruptible: true
upload:
cache: {}
variables:
GIT_STRATEGY: none
stage: upload packages
@ -411,7 +426,6 @@ upload:
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/uniworx-wflint ${PACKAGE_REGISTRY_URL}/${VERSION}/uniworx-wflint
release:
cache: {}
variables:
GIT_STRATEGY: none
stage: release