Files
debye_bec/.gitlab-ci.yml
2024-04-24 18:25:15 +02:00

67 lines
1.6 KiB
YAML

# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
include:
- template: Security/Secret-Detection.gitlab-ci.yml
#commands to run in the Docker container before starting each job.
before_script:
- pip install -e .[dev]
# different stages in the pipeline
stages:
- Formatter
- test
- AdditionalTests
- Deploy
secret_detection:
before_script:
- ''
formatter:
stage: Formatter
script:
- pip install black
- black --check --diff --color --line-length=100 ./
pytest:
stage: test
script:
- pytest -v --random-order ./tests
tests-3.11:
stage: AdditionalTests
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
needs: ["formatter"]
script:
- pytest -v --random-order ./tests
allow_failure: true
tests-3.12:
extends: "tests-3.11"
stage: AdditionalTests
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12
allow_failure: true
config_test:
stage: test
script:
- ophyd_test --config ./debye_bec/device_configs/ --output ./config_tests
artifacts:
paths:
- ./config_tests
when: on_failure
expire_in: "30 days"
allow_failure: false