mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-02-23 16:49:59 -05:00
72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
image: debian:testing
|
|
|
|
stages:
|
|
- linting
|
|
- test
|
|
- renovate
|
|
- build_container
|
|
|
|
variables:
|
|
CONTAINER_TEST_IMAGE: registry.0xacab.org/jvoisin/mat2-web:$CI_BUILD_REF_NAME
|
|
CONTAINER_RELEASE_IMAGE: registry.0xacab.org/jvoisin/mat2-web:latest
|
|
|
|
pyflakes:
|
|
stage: linting
|
|
script:
|
|
- apt-get -qqy update
|
|
- apt-get -qqy install --no-install-recommends pyflakes3
|
|
- pyflakes3 ./main.py
|
|
|
|
mypy:
|
|
stage: linting
|
|
script:
|
|
- apt-get -qqy update
|
|
- apt-get -qqy install --no-install-recommends python3-pip
|
|
- pip3 install mypy
|
|
- pip3 install -r requirements-test.txt
|
|
- mypy --ignore-missing-imports matweb main.py
|
|
|
|
bandit:
|
|
image:
|
|
name: $CI_REGISTRY/georg/mat2-ci-images:linting
|
|
stage: linting
|
|
script:
|
|
- bandit -r ./matweb/ main.py
|
|
|
|
tests:debian:
|
|
stage: test
|
|
before_script:
|
|
- apt update
|
|
script:
|
|
- apt-get -qqy update
|
|
- apt-get -qqy install --no-install-recommends mat2 python3-flask python3-coverage python3-pip python3-setuptools
|
|
- pip3 install wheel
|
|
- pip3 install -r requirements.txt -r requirements-test.txt
|
|
- python3-coverage run --branch --include main.py,matweb/*.py -m unittest discover -s test
|
|
- python3-coverage report -m
|
|
- python3-coverage xml
|
|
artifacts:
|
|
reports:
|
|
cobertura: coverage.xml
|
|
|
|
build-docker:
|
|
stage: build_container
|
|
image:
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
entrypoint: [""]
|
|
script:
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.production --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
|
only:
|
|
- tags
|
|
- master
|
|
|
|
renovate:
|
|
stage: renovate
|
|
variables:
|
|
RENOVATE_TOKEN: $GITLAB_API_TOKEN
|
|
image:
|
|
name: renovate/renovate:19
|
|
entrypoint: ['']
|
|
script:
|
|
- node /usr/src/app/dist/renovate.js --platform gitlab --endpoint ${CI_API_V4_URL} --token ${GITLAB_API_TOKEN} ${CI_PROJECT_PATH} |