ci: aggressive caching for api related jobs
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2286>
This commit is contained in:
parent
f027c8d04b
commit
7ff81e35f3
|
@ -12,6 +12,7 @@ variables:
|
||||||
|
|
||||||
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
|
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
|
||||||
YARN_CACHE_FOLDER: $CI_PROJECT_DIR/.cache/yarn
|
YARN_CACHE_FOLDER: $CI_PROJECT_DIR/.cache/yarn
|
||||||
|
POETRY_VIRTUALENVS_IN_PROJECT: "true"
|
||||||
|
|
||||||
.shared_variables:
|
.shared_variables:
|
||||||
# Keep the git files permissions during job setup
|
# Keep the git files permissions during job setup
|
||||||
|
@ -30,6 +31,16 @@ variables:
|
||||||
files: [front/yarn.lock]
|
files: [front/yarn.lock]
|
||||||
paths: [front/node_modules]
|
paths: [front/node_modules]
|
||||||
|
|
||||||
|
# Cache for api related jobs
|
||||||
|
# Include the python version to prevent loosing caches in the test matrix
|
||||||
|
api_cache: &api_cache
|
||||||
|
- key: api-pip-$PYTHON_VERSION
|
||||||
|
paths: [$PIP_CACHE_DIR]
|
||||||
|
- key:
|
||||||
|
prefix: api-venv-$PYTHON_VERSION
|
||||||
|
files: [api/poetry.lock]
|
||||||
|
paths: [api/.venv]
|
||||||
|
|
||||||
default:
|
default:
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
@ -195,8 +206,7 @@ test_api:
|
||||||
services:
|
services:
|
||||||
- postgres:15-alpine
|
- postgres:15-alpine
|
||||||
- redis:7-alpine
|
- redis:7-alpine
|
||||||
cache:
|
cache: *api_cache
|
||||||
paths: ["$PIP_CACHE_DIR"]
|
|
||||||
variables:
|
variables:
|
||||||
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||||
FUNKWHALE_URL: "https://funkwhale.ci"
|
FUNKWHALE_URL: "https://funkwhale.ci"
|
||||||
|
@ -255,10 +265,7 @@ build_api_schema:
|
||||||
services:
|
services:
|
||||||
- postgres:15-alpine
|
- postgres:15-alpine
|
||||||
- redis:7-alpine
|
- redis:7-alpine
|
||||||
cache:
|
cache: *api_cache
|
||||||
key: "$CI_PROJECT_ID__pip_cache"
|
|
||||||
paths:
|
|
||||||
- "$PIP_CACHE_DIR"
|
|
||||||
variables:
|
variables:
|
||||||
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||||
FUNKWHALE_URL: "https://funkwhale.ci"
|
FUNKWHALE_URL: "https://funkwhale.ci"
|
||||||
|
|
Loading…
Reference in New Issue