Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libmtime
Commits
a1386367
Commit
a1386367
authored
3 months ago
by
Sergey Kosukhin
Browse files
Options
Downloads
Patches
Plain Diff
ci: extract the pre-commit caching to a hidden job
parent
17d84c7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!69
Add pre-commit hook to check licenses
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+26
-18
26 additions, 18 deletions
.gitlab-ci.yml
with
26 additions
and
18 deletions
.gitlab-ci.yml
+
26
−
18
View file @
a1386367
...
...
@@ -25,6 +25,30 @@ workflow:
variables
:
CI_GITIGNORE_DIR
:
${CI_PROJECT_DIR}/.ci_dir
.common_pre_commit
:
extends
:
.ci_dir
variables
:
APK_CACHE_DIR
:
${CI_GITIGNORE_DIR}/apk-cache
PRE_COMMIT_HOME
:
${CI_GITIGNORE_DIR}/pre-commit
CACHE_POLICY
:
pull
before_script
:
-
mkdir -p "${APK_CACHE_DIR}"
-
apk update --cache-dir "${APK_CACHE_DIR}"
-
apk add --cache-dir "${APK_CACHE_DIR}" git pre-commit
tags
:
-
alpine
cache
:
-
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
${APK_CACHE_DIR}
policy
:
${CACHE_POLICY}
-
key
:
files
:
-
.pre-commit-config.yaml
paths
:
-
${PRE_COMMIT_HOME}
policy
:
${CACHE_POLICY}
Check licenses
:
before_script
:
-
python -m pip install --upgrade pip
...
...
@@ -41,32 +65,16 @@ Check licenses:
interruptible
:
true
Check style
:
extends
:
.c
i_dir
extends
:
.c
ommon_pre_commit
variables
:
APK_CACHE_DIR
:
${CI_GITIGNORE_DIR}/apk-cache
PRE_COMMIT_HOME
:
${CI_GITIGNORE_DIR}/pre-commit
before_script
:
-
mkdir -p "${APK_CACHE_DIR}"
-
apk update --cache-dir "${APK_CACHE_DIR}"
-
apk add --cache-dir "${APK_CACHE_DIR}" git pre-commit
CACHE_POLICY
:
pull-push
script
:
-
pre-commit run --show-diff-on-failure --color=always --all-files
tags
:
-
alpine
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "web"
when
:
manual
-
when
:
always
interruptible
:
true
cache
:
-
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
${APK_CACHE_DIR}
-
key
:
files
:
-
.pre-commit-config.yaml
paths
:
-
${PRE_COMMIT_HOME}
include
:
-
project
:
"
anw_dienste/ci-templates"
...
...
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