Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
6c52efb9
Unverified
Commit
6c52efb9
authored
4 years ago
by
Cam Saul
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use $CIRCLE_STAGE for the run-on-change cache key (#14328)
parent
4368fe5a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.circleci/config.yml
+45
-51
45 additions, 51 deletions
.circleci/config.yml
with
45 additions
and
51 deletions
.circleci/config.yml
+
45
−
51
View file @
6c52efb9
...
...
@@ -223,8 +223,9 @@ cache-key-frontend-deps: &CacheKeyFrontendDeps
key
:
v1-{{ checksum ".CACHE-PREFIX" }}-fe-deps-{{ checksum "yarn.lock" }}
# Key used for implementation of run-on-change -- this is the cache key that contains the .SUCCESS dummy file
# By default the key ALWAYS includes the name of the test job itself ($CIRCLE_STAGE) so you don't need to add that yourself.
cache-key-run-on-change
:
&CacheKeyRunOnChange
key
:
v1-{{ checksum ".CACHE-PREFIX" }}-run-on-change-<< parameters.c
ache-key
>>
key
:
v1-{{ checksum ".CACHE-PREFIX" }}-run-on-change-
{{ .Environment.CIRCLE_STAGE }}-
<< parameters.c
hecksum
>>
# Key for the local maven installation of metabase-core (used by build-uberjar-drivers)
cache-key-metabase-core
:
&CacheKeyMetabaseCore
...
...
@@ -307,8 +308,9 @@ commands:
# f. If .SUCCESS is not present, proceed as normal, and create and cache .SUCCESS if the job succeeds
run-on-change
:
parameters
:
c
ache-key
:
c
hecksum
:
type
:
string
default
:
"
"
steps
:
type
:
steps
# Whether to skip the rest of the job if commit message includes [ci quick]
...
...
@@ -317,7 +319,7 @@ commands:
default
:
false
steps
:
-
restore_cache
:
name
:
Restore dummy file .SUCCESS if it exists for cache key << parameters.c
ache-key
>>
name
:
Restore dummy file .SUCCESS if it exists for cache key << parameters.c
hecksum
>>
<<
:
*CacheKeyRunOnChange
-
when
:
condition
:
<< parameters.skip-job-if-commit-message-includes-ci-quick >>
...
...
@@ -356,7 +358,7 @@ commands:
command
:
|
echo "$CIRCLE_BUILD_URL" > .SUCCESS
-
save_cache
:
name
:
Persist dummy file .SUCCESS to cache with key << parameters.c
ache-key
>>
name
:
Persist dummy file .SUCCESS to cache with key << parameters.c
hecksum
>>
<<
:
*CacheKeyRunOnChange
paths
:
-
/home/circleci/metabase/metabase/.SUCCESS
...
...
@@ -365,7 +367,7 @@ commands:
command
:
rm /home/circleci/metabase/metabase/.SUCCESS
# Creates a file that contains checksums for all the files found using the find command with supplied arguments.
# You can use a checksum of the checksum file for cache keys including run-on-change cache
-
keys.
# You can use a checksum of the checksum file for cache keys including run-on-change cache
keys.
create-checksum-file
:
parameters
:
filename
:
...
...
@@ -420,21 +422,16 @@ commands:
after-steps
:
type
:
steps
default
:
[]
# If skip-key is passed, run this command using run-on-change; skip-key is used as part of the cache key used by
# it (.FRONTEND-CHECKSUMS is automatically used as well). It should be something unique for the job, e.g.
# "linter" or "unit-tests"
#
# If skip-key is not passed, the step will always be ran
skip-key
:
type
:
string
default
:
"
"
skip-when-no-change
:
type
:
boolean
default
:
false
steps
:
-
attach-workspace
-
when
:
condition
:
<< parameters.skip-
key
>>
condition
:
<< parameters.skip-
when-no-change
>>
steps
:
-
run-on-change
:
c
ache-key
:
yarn-<< parameters.skip-key >>-
{{ checksum ".FRONTEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".FRONTEND-CHECKSUMS"
}}
'
steps
:
-
restore-fe-deps-cache
-
steps
:
<< parameters.before-steps >>
...
...
@@ -444,7 +441,7 @@ commands:
no_output_timeout
:
10m
-
steps
:
<< parameters.after-steps >>
-
unless
:
condition
:
<< parameters.skip-
key
>>
condition
:
<< parameters.skip-
when-no-change
>>
steps
:
-
restore-fe-deps-cache
-
steps
:
<< parameters.before-steps >>
...
...
@@ -536,7 +533,7 @@ jobs:
find-args
:
"
.
-type
f
-name
'*.yaml'
-or
-name
'*.yml'"
-
run-on-change
:
# package.json is included in the cache key in case the yamllint dependency changes
c
ache-key
:
lint-yaml-
{{ checksum ".YAML-CHECKSUMS" }}-{{ checksum "package.json" }}
c
hecksum
:
'
{{
checksum
".YAML-CHECKSUMS"
}}-{{
checksum
"package.json"
}}
'
steps
:
-
run-yarn-command
:
command-name
:
Lint YAML files
...
...
@@ -554,7 +551,7 @@ jobs:
filename
:
.I18N-SCRIPT-CHECKSUMS
find-args
:
"
bin/i18n
-type
f"
-
run-on-change
:
c
ache-key
:
verify-i18n-
{{ checksum ".I18N-CHECKSUMS" }}-{{ checksum ".I18N-SCRIPT-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".I18N-CHECKSUMS"
}}-{{
checksum
".I18N-SCRIPT-CHECKSUMS"
}}
'
steps
:
-
restore-fe-deps-cache
-
run
:
...
...
@@ -584,7 +581,7 @@ jobs:
# This step is pretty slow, even with the cache, so only run it if project.clj has changed
# TODO -- we should cache the build script deps as well, and driver deps?
-
run-on-change
:
c
ache-key
:
be-deps-
{{ checksum "project.clj" }}
c
hecksum
:
'
{{
checksum
"project.clj"
}}
'
steps
:
-
restore-be-deps-cache
-
run
:
lein with-profile +include-all-drivers,+cloverage,+junit,+<< parameters.edition >> deps
...
...
@@ -607,21 +604,18 @@ jobs:
after-steps
:
type
:
steps
default
:
[]
# If skip-key is present, this job is ran with run-on-change which means it will be skipped if nothing has
# changed. It works the same way as the skip-key command used for run-yarn-command: see comments there for more
# details
skip-key
:
type
:
string
default
:
"
"
skip-when-no-change
:
type
:
boolean
default
:
false
<<
:
*Params
executor
:
<< parameters.e >>
steps
:
-
attach-workspace
-
when
:
condition
:
<< parameters.skip-
key
>>
condition
:
<< parameters.skip-
when-no-change
>>
steps
:
-
run-on-change
:
c
ache-key
:
lein-<< parameters.skip-key >>-
{{ checksum ".BACKEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}
'
steps
:
-
run-lein-command
:
before-steps
:
<< parameters.before-steps >>
...
...
@@ -629,7 +623,7 @@ jobs:
after-steps
:
<< parameters.after-steps >>
edition
:
<< parameters.edition >>
-
unless
:
condition
:
<< parameters.skip-
key
>>
condition
:
<< parameters.skip-
when-no-change
>>
steps
:
-
run-lein-command
:
before-steps
:
<< parameters.before-steps >>
...
...
@@ -642,7 +636,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
reflection-warnings-
{{ checksum ".BACKEND-CHECKSUMS" }}-{{ checksum "bin/reflection-linter" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}-{{
checksum
"bin/reflection-linter"
}}
'
steps
:
-
restore-be-deps-cache
-
run
:
...
...
@@ -670,7 +664,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
driver-tests-<< parameters.driver >>-
{{ checksum ".BACKEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}
'
skip-job-if-commit-message-includes-ci-quick
:
true
steps
:
-
restore-be-deps-cache
...
...
@@ -695,7 +689,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
load-and-dump-<< parameters.db-type >>-
{{ checksum ".BACKEND-CHECKSUMS" }}-{{ checksum "bin/test-load-and-dump.sh" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}-{{
checksum
"bin/test-load-and-dump.sh"
}}
'
steps
:
-
restore-be-deps-cache
-
run
:
...
...
@@ -712,7 +706,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
build-scripts-
{{ checksum ".BACKEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}
'
steps
:
-
restore-be-deps-cache
-
run
:
...
...
@@ -747,7 +741,7 @@ jobs:
-
attach-workspace
# This step is *really* slow, so we can skip it if yarn.lock hasn't changed since last time we ran it
-
run-on-change
:
c
ache-key
:
fe-deps-
{{ checksum "yarn.lock" }}
c
hecksum
:
'
{{
checksum
"yarn.lock"
}}
'
steps
:
-
restore-fe-deps-cache
-
run
:
...
...
@@ -769,7 +763,7 @@ jobs:
-
run-yarn-command
:
command-name
:
Run ESLint linter
command
:
lint-eslint
skip-
key
:
eslint
skip-
when-no-change
:
true
fe-linter-prettier
:
executor
:
node
...
...
@@ -777,7 +771,7 @@ jobs:
-
run-yarn-command
:
command-name
:
Run Prettier formatting linter
command
:
lint-prettier
skip-
key
:
prettier
skip-
when-no-change
:
true
fe-linter-flow
:
executor
:
node
...
...
@@ -785,7 +779,7 @@ jobs:
-
run-yarn-command
:
command-name
:
Run Flow type checker
command
:
lint-flow
skip-
key
:
flow
skip-
when-no-change
:
true
fe-linter-docs-links
:
executor
:
node
...
...
@@ -795,7 +789,7 @@ jobs:
filename
:
"
.MARKDOWN-CHECKSUMS"
find-args
:
"
.
-type
f
-name
'*.md'"
-
run-on-change
:
c
ache-key
:
docs-links-
{{ checksum ".MARKDOWN-CHECKSUMS" }}-{{ checksum ".FRONTEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".MARKDOWN-CHECKSUMS"
}}-{{
checksum
".FRONTEND-CHECKSUMS"
}}
'
steps
:
-
run-yarn-command
:
command-name
:
Run docs links checker
...
...
@@ -807,7 +801,7 @@ jobs:
-
run-yarn-command
:
command-name
:
Run frontend unit tests
command
:
run test-unit
skip-
key
:
unit
skip-
when-no-change
:
true
fe-tests-integration
:
executor
:
node
...
...
@@ -815,7 +809,7 @@ jobs:
-
run-yarn-command
:
command-name
:
Run frontend integration tests
command
:
run test-integration
skip-
key
:
integration
skip-
when-no-change
:
true
fe-tests-timezones
:
executor
:
node
...
...
@@ -823,7 +817,7 @@ jobs:
-
run-yarn-command
:
command-name
:
Run frontend timezone tests
command
:
run test-timezones
skip-
key
:
timezones
skip-
when-no-change
:
true
# Unlike the other build-uberjar steps, this step should be run once overall and the results can be shared between
# OSS and EE uberjars.
...
...
@@ -839,7 +833,7 @@ jobs:
#
# The build-drivers script is smart enough to only rebuild drivers if needed -- there's a chance we won't
# need to rebuild them.
c
ache-key
:
drivers-
{{ checksum ".MODULES-CHECKSUMS" }}-{{ checksum ".BACKEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".MODULES-CHECKSUMS"
}}-{{
checksum
".BACKEND-CHECKSUMS"
}}
'
steps
:
-
restore-be-deps-cache
#
-
restore_cache
:
...
...
@@ -882,7 +876,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
frontend-<< parameters.edition >>-
{{ checksum ".FRONTEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".FRONTEND-CHECKSUMS"
}}
'
steps
:
-
restore-fe-deps-cache
-
run
:
...
...
@@ -905,7 +899,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
uberjar-<< parameters.edition >>-
{{ checksum ".BACKEND-CHECKSUMS" }}-{{ checksum ".FRONTEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}-{{
checksum
".FRONTEND-CHECKSUMS"
}}
'
steps
:
-
restore_cache
:
name
:
Restore cached uberjar from previous runs
...
...
@@ -971,7 +965,7 @@ jobs:
steps
:
-
attach-workspace
-
run-on-change
:
c
ache-key
:
cypress-<< parameters.edition >>-<< parameters.cypress-group >>-<< parameters.only-single-database >>-<< parameters.test-files-location >>-<< parameters.node >>-
{{ checksum ".BACKEND-CHECKSUMS" }}-{{ checksum ".FRONTEND-CHECKSUMS" }}
c
hecksum
:
'
{{
checksum
".BACKEND-CHECKSUMS"
}}-{{
checksum
".FRONTEND-CHECKSUMS"
}}
'
steps
:
-
run-yarn-command
:
command-name
:
Run Cypress tests
...
...
@@ -1060,7 +1054,7 @@ workflows:
requires
:
-
be-deps
lein-command
:
with-profile +junit test
skip-
key
:
tests
skip-
when-no-change
:
true
<<
:
*Matrix
-
lein
:
...
...
@@ -1069,7 +1063,7 @@ workflows:
-
be-deps
e
:
java-11
lein-command
:
with-profile +junit test
skip-
key
:
tests-java-11
skip-
when-no-change
:
true
<<
:
*Matrix
-
lein
:
...
...
@@ -1077,28 +1071,28 @@ workflows:
requires
:
-
be-deps
lein-command
:
eastwood
skip-
key
:
eastwood
skip-
when-no-change
:
true
-
lein
:
name
:
be-linter-docstring-checker
requires
:
-
be-deps
lein-command
:
docstring-checker
skip-
key
:
docstring-checker
skip-
when-no-change
:
true
-
lein
:
name
:
be-linter-namespace-decls
requires
:
-
be-deps
lein-command
:
check-namespace-decls
skip-
key
:
namespace-decls
skip-
when-no-change
:
true
-
lein
:
name
:
be-linter-bikeshed
requires
:
-
be-deps
lein-command
:
bikeshed
skip-
key
:
bikeshed
skip-
when-no-change
:
true
-
lein
:
name
:
be-linter-cloverage
...
...
@@ -1109,7 +1103,7 @@ workflows:
-
run
:
name
:
Upload code coverage to codecov.io
command
:
bash <(curl -s https://codecov.io/bash)
skip-
key
:
cloverag
e
skip-
when-no-change
:
tru
e
-
be-linter-reflection-warnings
:
requires
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment