pmbootstrap/.gitlab-ci.yml

75 lines
1.5 KiB
YAML

image: alpine:edge
# The mr-settings check needs to run in a MR specific context. With this block,
# the whole pipeline runs in that context for MRs. Otherwise we would have two
# pipelines for MRs.
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'wip'
- if: $CI_COMMIT_BRANCH == 'docs'
before_script: &global_before_scripts
- ".ci/note.sh"
- apk upgrade -U
- "adduser -D build"
stages:
- lint
- test
codespell:
stage: lint
script:
- ".ci/codespell.sh"
pytest:
stage: test
script:
- "apk -q add git"
- "su build -c 'git config --global user.email ci@ci'"
- "su build -c 'git config --global user.name CI'"
- "echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
- ".ci/pytest.sh"
ruff:
stage: lint
script:
- ".ci/ruff.sh"
shellcheck:
stage: lint
script:
- ".ci/shellcheck.sh"
vermin:
stage: lint
script:
- ".ci/vermin.sh"
mr-settings:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
before_script:
- *global_before_scripts
- "apk -q add python3"
- "wget -q 'https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py'"
script:
- "python3 ./check_mr_settings.py"
mypy:
stage: lint
script:
- ".ci/mypy.sh"
docs:
stage: lint
script:
- apk add py3-sphinx py3-sphinx_rtd_theme
- ".ci/docs.sh"
artifacts:
paths:
- public