Skip to content
Snippets Groups Projects
Commit 96d2ff39 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'fix/reports_on_variants' into 'master'

fix: fix variants missing reports/ by move mkdir at job level

Closes #99

See merge request to-be-continuous/python!135
parents f70a71a7 bf15efe4
No related branches found
No related tags found
No related merge requests found
...@@ -990,7 +990,6 @@ stages: ...@@ -990,7 +990,6 @@ stages:
- install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
- cd ${PYTHON_PROJECT_DIR} - cd ${PYTHON_PROJECT_DIR}
- guess_build_system - guess_build_system
- mkdir -p -m 777 reports
.python-test: .python-test:
extends: .python-base extends: .python-base
...@@ -1030,6 +1029,7 @@ py-lint: ...@@ -1030,6 +1029,7 @@ py-lint:
extends: .python-base extends: .python-base
stage: build stage: build
script: script:
- mkdir -p -m 777 reports
- install_requirements - install_requirements
- _pip install pylint_gitlab # codeclimate reports - _pip install pylint_gitlab # codeclimate reports
# run pylint and generate reports all at once # run pylint and generate reports all at once
...@@ -1090,6 +1090,7 @@ py-ruff: ...@@ -1090,6 +1090,7 @@ py-ruff:
extends: .python-base extends: .python-base
stage: build stage: build
script: script:
- mkdir -p -m 777 reports
- | - |
if [[ ${BANDIT_ENABLED} == "true" || ${PYLINT_ENABLED} == "true" || ${PYTHON_ISORT_ENABLED} == "true" ]]; then if [[ ${BANDIT_ENABLED} == "true" || ${PYLINT_ENABLED} == "true" || ${PYTHON_ISORT_ENABLED} == "true" ]]; then
log_warn "Ruff can replace isort, Bandit, Pylint" log_warn "Ruff can replace isort, Bandit, Pylint"
...@@ -1141,6 +1142,7 @@ py-mypy: ...@@ -1141,6 +1142,7 @@ py-mypy:
variables: variables:
MYPY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/mypy" MYPY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/mypy"
script: script:
- mkdir -p -m 777 reports
- install_requirements - install_requirements
- _pip install mypy mypy-to-codeclimate - _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 - _run mypy ${MYPY_ARGS} ${MYPY_FILES:-$(find -type f -name "*.py" -not -path "./.cache/*" -not -path "./.venv/*")} | tee reports/py-mypy.console.txt || true
...@@ -1166,6 +1168,7 @@ py-mypy: ...@@ -1166,6 +1168,7 @@ py-mypy:
py-unittest: py-unittest:
extends: .python-test extends: .python-test
script: script:
- mkdir -p -m 777 reports
- install_requirements - install_requirements
# code coverage # code coverage
- _pip install coverage - _pip install coverage
...@@ -1183,6 +1186,7 @@ py-unittest: ...@@ -1183,6 +1186,7 @@ py-unittest:
py-pytest: py-pytest:
extends: .python-test extends: .python-test
script: script:
- mkdir -p -m 777 reports
- install_requirements - install_requirements
- _pip install pytest pytest-cov coverage - _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} - _python -m pytest --junit-xml=reports/TEST-pytests.xml --cov --cov-report term --cov-report xml:reports/py-coverage.cobertura.xml ${PYTEST_ARGS}
...@@ -1195,6 +1199,7 @@ py-pytest: ...@@ -1195,6 +1199,7 @@ py-pytest:
py-nosetests: py-nosetests:
extends: .python-test extends: .python-test
script: script:
- mkdir -p -m 777 reports
- install_requirements - 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} - _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: rules:
...@@ -1210,6 +1215,7 @@ py-bandit: ...@@ -1210,6 +1215,7 @@ py-bandit:
# force no dependencies # force no dependencies
dependencies: [] dependencies: []
script: script:
- mkdir -p -m 777 reports
- install_requirements - install_requirements
- _pip install bandit - _pip install bandit
# CSV (for SonarQube) # CSV (for SonarQube)
...@@ -1245,6 +1251,7 @@ py-trivy: ...@@ -1245,6 +1251,7 @@ py-trivy:
# force no dependencies # force no dependencies
dependencies: [] dependencies: []
script: script:
- mkdir -p -m 777 reports
- | - |
if [[ -z "$PYTHON_TRIVY_DIST_URL" ]] if [[ -z "$PYTHON_TRIVY_DIST_URL" ]]
then then
...@@ -1323,6 +1330,7 @@ py-sbom: ...@@ -1323,6 +1330,7 @@ py-sbom:
dependencies: [] dependencies: []
needs: [] needs: []
script: script:
- mkdir -p -m 777 reports
- | - |
case "$PYTHON_BUILD_SYSTEM" in case "$PYTHON_BUILD_SYSTEM" in
poetry*|pipenv*) poetry*|pipenv*)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment