majuna/.gitlab-ci.yml

76 lines
2.2 KiB
YAML

image: python:3.8-bullseye
test:bandit:
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt --quiet
- pip install bandit --quiet
- bandit -r app
test:docs:
stage: test
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt
- pip install -U sphinx sphinx-press-theme sphinx-jsonschema
- pushd scripts && python update_schemas.py && popd
- pushd docs && sphinx-build -b html . ../public && popd
rules:
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
test:flake8:
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt --quiet
- pip install flake8 --quiet
- flake8 app
test:mypy:
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt --quiet
- pip install -r requirements-types.txt --quiet
- mypy app
test:nose:
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt --quiet
- pip install nose
- DISABLE_METRICS=true nosetests tests
test:pylint:
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt --quiet
- pip install pylint --quiet
- pip install https://github.com/anybox/pylint_flask_sqlalchemy/archive/refs/heads/master.zip --quiet
- pylint app
allow_failure: true
test:migration:
script:
- cp config.yaml.example config.yaml
- pip install -r requirements.txt --quiet
- sh scripts/test_migrate.sh
pages:
stage: deploy
script:
- cp config.yaml.example config.yaml
- apt update && apt install build-essential
- pip install -r requirements.txt
- pip install -U sphinx sphinx-press-theme sphinx-jsonschema
- pushd scripts && python update_schemas.py && popd
- pushd docs && sphinx-build -b html . ../public && popd
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH