allianceauth/.gitlab-ci.yml
2021-05-17 09:46:11 +02:00

108 lines
1.8 KiB
YAML

stages:
- pre-commit
- gitlab
- test
- deploy
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
before_script:
- apt-get update && apt-get install redis-server -y
- redis-server --daemonize yes
- python -V
- pip install wheel tox
pre-commit-check:
stage: pre-commit
image: python:3.6-buster
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
paths:
- ${PRE_COMMIT_HOME}
script:
- pip install pre-commit
- pre-commit run --all-files
sast:
stage: gitlab
before_script: []
dependency_scanning:
stage: gitlab
before_script:
- apt-get update && apt-get install redis-server libmariadbclient-dev -y
- redis-server --daemonize yes
- python -V
- pip install wheel tox
test-3.7-core:
image: python:3.7-buster
script:
- tox -e py37-core
artifacts:
when: always
reports:
cobertura: coverage.xml
test-3.8-core:
image: python:3.8-buster
script:
- tox -e py38-core
artifacts:
when: always
reports:
cobertura: coverage.xml
test-3.9-core:
image: python:3.9-buster
script:
- tox -e py39-core
artifacts:
when: always
reports:
cobertura: coverage.xml
test-3.7-all:
image: python:3.7-buster
script:
- tox -e py37-all
artifacts:
when: always
reports:
cobertura: coverage.xml
test-3.8-all:
image: python:3.8-buster
script:
- tox -e py38-all
artifacts:
when: always
reports:
cobertura: coverage.xml
test-3.9-all:
image: python:3.9-buster
script:
- tox -e py39-all
artifacts:
when: always
reports:
cobertura: coverage.xml
deploy_production:
stage: deploy
image: python:3.9-buster
before_script:
- pip install twine wheel
script:
- python setup.py sdist bdist_wheel
- twine upload dist/*
rules:
- if: $CI_COMMIT_TAG