Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GitLab CI Cache Usage Examples
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Klaus Reuter
GitLab CI Cache Usage Examples
Commits
72271bb2
Commit
72271bb2
authored
3 years ago
by
Klaus Reuter
Browse files
Options
Downloads
Patches
Plain Diff
retry educational example
parent
d4484589
No related branches found
No related tags found
No related merge requests found
Pipeline
#138134
failed
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+21
-58
21 additions, 58 deletions
.gitlab-ci.yml
with
21 additions
and
58 deletions
.gitlab-ci.yml
+
21
−
58
View file @
72271bb2
stages
:
# List of stages for jobs, and their order of execution
-
build
-
test
-
deploy
cache
:
&global_cache
# key: $CI_COMMIT_REF_SLUG
key
:
$CI_COMMIT_SHA
paths
:
-
bin
policy
:
pull-push
build-job
:
# This job runs in the build stage, which runs first.
stage
:
build
tags
:
-
cloud
script
:
-
echo "Compiling the code..."
-
echo "Compile complete."
-
mkdir -p bin
-
cp /usr/bin/rev bin
unit-test-job
:
# This job runs in the test stage.
stage
:
test
# It only starts when the job in the build stage completes successfully.
tags
:
-
cloud-gpu
cache
:
# inherit all global cache settings
<<
:
*global_cache
# override the policy
policy
:
pull
script
:
-
echo "Running unit tests... This will take about 60 seconds." | bin/rev
lint-test-job
:
# This job also runs in the test stage.
stage
:
test
# It can run at the same time as unit-test-job (in parallel).
tags
:
-
cloud
cache
:
# inherit all global cache settings
<<
:
*global_cache
# override the policy
policy
:
pull
script
:
-
echo "Linting code... This will take about 10 seconds." | bin/rev
deploy-job
:
# This job runs in the deploy stage.
stage
:
deploy
# It only runs when *both* jobs in the test stage complete successfully.
tags
:
-
cloud
cache
:
# inherit all global cache settings
<<
:
*global_cache
# override the policy
policy
:
pull
script
:
-
echo "Deploying application..."
-
echo "Application successfully deployed." | bin/rev
test_python_numpy
:
image
:
python:3.9
tags
:
- docker
cache
:
key
:
"
python39_pip_cache_20220731"
paths
:
-
.cache/pip
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
before_script
:
-
pip install numpy==1.22.4
script
:
-
>
python -c
"
import numpy as np
A = np.random.rand(32,32)
B = np.linalg.inv(A)
C = A @ B
assert(np.allclose(C.diagonal(), np.ones(32)))
"
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