gitlab-ci: add "lint" pre-stage before default "test" stage

This commit is contained in:
Hans-Christoph Steiner 2025-03-27 02:33:40 +01:00
parent 7f67a882e7
commit 9bcd13bfdd

View file

@ -11,6 +11,12 @@ workflow:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
stages:
- lint
- test # default for jobs that do not specify stage:
- deploy
variables: variables:
pip: pip3 --timeout 100 --retries 10 pip: pip3 --timeout 100 --retries 10
# speed up git checkout phase # speed up git checkout phase
@ -222,6 +228,7 @@ gradlew-fdroid:
# Run all the various linters and static analysis tools. # Run all the various linters and static analysis tools.
hooks/pre-commit: hooks/pre-commit:
stage: lint
image: debian:bookworm-slim image: debian:bookworm-slim
variables: variables:
LANG: C.UTF-8 LANG: C.UTF-8
@ -253,6 +260,7 @@ bandit:
- bandit -r -ii --ini .bandit - bandit -r -ii --ini .bandit
pylint: pylint:
stage: lint
image: debian:bookworm-slim image: debian:bookworm-slim
<<: *python-rules-changes <<: *python-rules-changes
<<: *apt-template <<: *apt-template
@ -273,6 +281,7 @@ pylint:
shellcheck: shellcheck:
stage: lint
image: debian:bookworm-slim image: debian:bookworm-slim
rules: rules:
- changes: - changes:
@ -325,6 +334,7 @@ safety:
# TODO tests/*/*/*.yaml are not covered # TODO tests/*/*/*.yaml are not covered
yamllint: yamllint:
stage: lint
image: debian:bookworm-slim image: debian:bookworm-slim
rules: rules:
- changes: - changes:
@ -349,6 +359,7 @@ yamllint:
locales: locales:
stage: lint
image: debian:bookworm-slim image: debian:bookworm-slim
variables: variables:
LANG: C.UTF-8 LANG: C.UTF-8
@ -367,6 +378,7 @@ locales:
black: black:
stage: lint
image: debian:bookworm-slim image: debian:bookworm-slim
<<: *apt-template <<: *apt-template
script: script: