mat2-web/.gitlab-ci.yml

70 lines
1.9 KiB
YAML
Raw Normal View History

2022-04-23 16:29:12 +02:00
image: debian:stable
2018-12-16 20:39:08 +01:00
stages:
- linting
- test
2020-05-14 18:54:52 +02:00
- renovate
- build_container
2018-12-16 20:39:08 +01:00
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
2021-06-13 10:58:02 +00:00
- pip3 install -r requirements-test.txt
- mypy --ignore-missing-imports --explicit-package-bases matweb main.py
2018-12-16 20:39:08 +01:00
2020-05-21 17:22:58 +02:00
bandit:
image:
name: $CI_REGISTRY/georg/mat2-ci-images:linting
2020-05-21 17:28:54 +02:00
stage: linting
2020-05-21 17:22:58 +02:00
script:
- bandit -r ./matweb/ main.py
2018-12-16 20:39:08 +01:00
tests:debian:
stage: test
2021-03-18 16:13:00 +01:00
before_script:
- apt update
2018-12-16 20:39:08 +01:00
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:
2022-06-06 13:10:05 +00:00
coverage_report:
coverage_format: cobertura
path: coverage.xml
2019-08-28 08:33:28 -07:00
build-docker:
stage: build_container
2019-08-28 08:33:28 -07:00
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
2020-05-14 18:54:52 +02:00
- master
renovate:
stage: renovate
variables:
RENOVATE_TOKEN: $GITLAB_API_TOKEN
image:
name: renovate/renovate:34
2020-05-14 18:54:52 +02:00
entrypoint: ['']
script:
- node /usr/src/app/dist/renovate.js --platform gitlab --endpoint ${CI_API_V4_URL} --token ${GITLAB_API_TOKEN} ${CI_PROJECT_PATH}