2022-06-10 16:45:04 +01:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
|
|
|
|
static:
|
|
|
|
image: node:alpine
|
|
|
|
stage: build
|
|
|
|
cache:
|
2022-06-10 16:56:07 +01:00
|
|
|
key: npm-$CI_COMMIT_REF_SLUG
|
2022-06-10 16:45:04 +01:00
|
|
|
paths:
|
2022-06-10 16:56:07 +01:00
|
|
|
- "$CI_PROJECT_DIR/.npm-cache"
|
2022-06-10 16:45:04 +01:00
|
|
|
script:
|
2022-06-10 16:56:07 +01:00
|
|
|
- npm ci --cache .npm-cache --prefer-offline
|
2022-06-10 16:45:04 +01:00
|
|
|
- npm run build
|
|
|
|
artifacts:
|
|
|
|
name: '$CI_JOB_ID-node_modules'
|
|
|
|
paths:
|
|
|
|
- ./node_modules
|
|
|
|
- ./static/build
|
|
|
|
expire_in: 30 mins
|
|
|
|
|
|
|
|
pip:
|
|
|
|
image: python:3.9-slim
|
|
|
|
stage: build
|
2022-06-10 16:56:07 +01:00
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $CI_PROJECT_DIR/.pip-cache
|
|
|
|
cache:
|
|
|
|
key: pip-$CI_COMMIT_REF_SLUG
|
|
|
|
paths:
|
|
|
|
- "$CI_PROJECT_DIR/.pip-cache"
|
2022-06-10 16:45:04 +01:00
|
|
|
script:
|
|
|
|
- python -m venv env
|
|
|
|
- source env/bin/activate
|
|
|
|
- pip install -r dev-requirements.txt
|
|
|
|
artifacts:
|
|
|
|
name: 'pip-$CI_JOB_ID'
|
|
|
|
paths:
|
|
|
|
- ./env/
|
|
|
|
expire_in: 30 mins
|
|
|
|
|
|
|
|
test_python:
|
|
|
|
image: python:3.9-slim
|
|
|
|
stage: test
|
|
|
|
dependencies:
|
|
|
|
- pip
|
|
|
|
- static
|
|
|
|
before_script:
|
|
|
|
- source env/bin/activate
|
2022-06-10 16:56:25 +01:00
|
|
|
variables:
|
|
|
|
SECRET_KEY: super-secret
|
2022-06-10 16:45:04 +01:00
|
|
|
script:
|
|
|
|
- ./manage.py test
|