Skip to content

Commit

Permalink
ci: enable cache in GitLab CI/CD (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored May 7, 2024
1 parent f85d58f commit fd97d05
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitlab/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ ci:
coverage_report:
coverage_format: cobertura
path: coverage.xml
cache:
paths:
- .venv
key:
files:
- pdm.lock
prefix: venv-${PYTHON_VERSION}
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
image: ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}
interruptible: true
Expand Down
8 changes: 8 additions & 0 deletions .gitlab/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ pages-build:
- public
- docs/changelog.md
- release-notes.md
cache:
paths:
- .venv
key:
files:
- pdm.lock
prefix: venv-${PYTHON_VERSION}
policy: pull
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ ci:
coverage_report:
coverage_format: cobertura
path: coverage.xml
cache:
paths:
- .venv
key:
files:
- pdm.lock
prefix: venv-${PYTHON_VERSION}
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
image: ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}
interruptible: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ pages-build:
- public
- docs/changelog.md
- release-notes.md
cache:
paths:
- .venv
key:
files:
- pdm.lock
prefix: venv-${PYTHON_VERSION}
policy: pull
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
Expand Down

0 comments on commit fd97d05

Please sign in to comment.