feat: introduce CI/CD with tests
Using a custom base image installed on the runner, the installation and tests should work (fast). ref: N25B-367
This commit is contained in:
38
.gitlab-ci.yml
Normal file
38
.gitlab-ci.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# ---------- GLOBAL SETUP ---------- #
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- install
|
||||||
|
- test
|
||||||
|
|
||||||
|
default:
|
||||||
|
image: qi-py-ri-base:latest
|
||||||
|
cache:
|
||||||
|
key: "${CI_COMMIT_REF_SLUG}"
|
||||||
|
paths:
|
||||||
|
- .venv/
|
||||||
|
policy: pull-push
|
||||||
|
|
||||||
|
# --------- INSTALLING --------- #
|
||||||
|
install:
|
||||||
|
stage: install
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
script:
|
||||||
|
- pip install -r requirements.txt
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- .venv/
|
||||||
|
expire_in: 1h
|
||||||
|
|
||||||
|
# ---------- TESTING ---------- #
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
needs:
|
||||||
|
- install
|
||||||
|
tags:
|
||||||
|
- test
|
||||||
|
script:
|
||||||
|
- PYTHONPATH=${PYTHONPATH}:src pytest test/
|
||||||
Reference in New Issue
Block a user