Loading templates/gitlab-ci-python.yml +9 −1 Original line number Diff line number Diff line Loading @@ -985,7 +985,6 @@ stages: - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" - cd ${PYTHON_PROJECT_DIR} - guess_build_system - mkdir -p -m 777 reports .python-test: extends: .python-base Loading Loading @@ -1025,6 +1024,7 @@ py-lint: extends: .python-base stage: build script: - mkdir -p -m 777 reports - install_requirements - _pip install pylint_gitlab # codeclimate reports # run pylint and generate reports all at once Loading Loading @@ -1085,6 +1085,7 @@ py-ruff: extends: .python-base stage: build script: - mkdir -p -m 777 reports - | if [[ ${BANDIT_ENABLED} == "true" || ${PYLINT_ENABLED} == "true" || ${PYTHON_ISORT_ENABLED} == "true" ]]; then log_warn "Ruff can replace isort, Bandit, Pylint" Loading Loading @@ -1136,6 +1137,7 @@ py-mypy: variables: MYPY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/mypy" script: - mkdir -p -m 777 reports - install_requirements - _pip install mypy mypy-to-codeclimate - _run mypy ${MYPY_ARGS} ${MYPY_FILES:-$(find -type f -name "*.py" -not -path "./.cache/*" -not -path "./.venv/*")} | tee reports/py-mypy.console.txt || true Loading @@ -1161,6 +1163,7 @@ py-mypy: py-unittest: extends: .python-test script: - mkdir -p -m 777 reports - install_requirements # code coverage - _pip install coverage Loading @@ -1178,6 +1181,7 @@ py-unittest: py-pytest: extends: .python-test script: - mkdir -p -m 777 reports - install_requirements - _pip install pytest pytest-cov coverage - _python -m pytest --junit-xml=reports/TEST-pytests.xml --cov --cov-report term --cov-report xml:reports/py-coverage.cobertura.xml ${PYTEST_ARGS} Loading @@ -1190,6 +1194,7 @@ py-pytest: py-nosetests: extends: .python-test script: - mkdir -p -m 777 reports - install_requirements - _run nosetests --with-xunit --xunit-file=reports/TEST-nosetests.xml --with-coverage --cover-erase --cover-xml --cover-xml-file=reports/py-coverage.cobertura.xml ${NOSETESTS_ARGS} rules: Loading @@ -1205,6 +1210,7 @@ py-bandit: # force no dependencies dependencies: [] script: - mkdir -p -m 777 reports - install_requirements - _pip install bandit # CSV (for SonarQube) Loading Loading @@ -1240,6 +1246,7 @@ py-trivy: # force no dependencies dependencies: [] script: - mkdir -p -m 777 reports - | if [[ -z "$PYTHON_TRIVY_DIST_URL" ]] then Loading Loading @@ -1318,6 +1325,7 @@ py-sbom: dependencies: [] needs: [] script: - mkdir -p -m 777 reports - | case "$PYTHON_BUILD_SYSTEM" in poetry*|pipenv*) Loading Loading
templates/gitlab-ci-python.yml +9 −1 Original line number Diff line number Diff line Loading @@ -985,7 +985,6 @@ stages: - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" - cd ${PYTHON_PROJECT_DIR} - guess_build_system - mkdir -p -m 777 reports .python-test: extends: .python-base Loading Loading @@ -1025,6 +1024,7 @@ py-lint: extends: .python-base stage: build script: - mkdir -p -m 777 reports - install_requirements - _pip install pylint_gitlab # codeclimate reports # run pylint and generate reports all at once Loading Loading @@ -1085,6 +1085,7 @@ py-ruff: extends: .python-base stage: build script: - mkdir -p -m 777 reports - | if [[ ${BANDIT_ENABLED} == "true" || ${PYLINT_ENABLED} == "true" || ${PYTHON_ISORT_ENABLED} == "true" ]]; then log_warn "Ruff can replace isort, Bandit, Pylint" Loading Loading @@ -1136,6 +1137,7 @@ py-mypy: variables: MYPY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/mypy" script: - mkdir -p -m 777 reports - install_requirements - _pip install mypy mypy-to-codeclimate - _run mypy ${MYPY_ARGS} ${MYPY_FILES:-$(find -type f -name "*.py" -not -path "./.cache/*" -not -path "./.venv/*")} | tee reports/py-mypy.console.txt || true Loading @@ -1161,6 +1163,7 @@ py-mypy: py-unittest: extends: .python-test script: - mkdir -p -m 777 reports - install_requirements # code coverage - _pip install coverage Loading @@ -1178,6 +1181,7 @@ py-unittest: py-pytest: extends: .python-test script: - mkdir -p -m 777 reports - install_requirements - _pip install pytest pytest-cov coverage - _python -m pytest --junit-xml=reports/TEST-pytests.xml --cov --cov-report term --cov-report xml:reports/py-coverage.cobertura.xml ${PYTEST_ARGS} Loading @@ -1190,6 +1194,7 @@ py-pytest: py-nosetests: extends: .python-test script: - mkdir -p -m 777 reports - install_requirements - _run nosetests --with-xunit --xunit-file=reports/TEST-nosetests.xml --with-coverage --cover-erase --cover-xml --cover-xml-file=reports/py-coverage.cobertura.xml ${NOSETESTS_ARGS} rules: Loading @@ -1205,6 +1210,7 @@ py-bandit: # force no dependencies dependencies: [] script: - mkdir -p -m 777 reports - install_requirements - _pip install bandit # CSV (for SonarQube) Loading Loading @@ -1240,6 +1246,7 @@ py-trivy: # force no dependencies dependencies: [] script: - mkdir -p -m 777 reports - | if [[ -z "$PYTHON_TRIVY_DIST_URL" ]] then Loading Loading @@ -1318,6 +1325,7 @@ py-sbom: dependencies: [] needs: [] script: - mkdir -p -m 777 reports - | case "$PYTHON_BUILD_SYSTEM" in poetry*|pipenv*) Loading