From adb2b3aa8b539522974fb38b7d255bcebd4c5809 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 10 Jun 2022 16:45:04 +0100 Subject: [PATCH] Add CI config --- .gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f3ede23 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,45 @@ +stages: + - build + - test + +static: + image: node:alpine + stage: build + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - .npm + - .cache + script: + - npm ci --cache .npm --prefer-offline + - 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 + 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 + script: + - ./manage.py test