diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c36a94..9a7f9d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,26 +18,26 @@ include: - template: Security/SAST-IaC.gitlab-ci.yml unittest: - stage: test + stage: 'test' image: python only: - test cache: paths: - - $CI_PROJECT_DIR/venv/ + - $CI_PROJECT_DIR/venv/ before_script: - cd $CI_PROJECT_DIR - python -m venv venv - chmod u+x venv/bin/activate - source venv/bin/activate - - pip install --quiet -r requirements.txt + - pip install --quiet -U -r requirements.txt - cd tests script: - pytest -v -coverage: +qodana: stage: 'code_quality' - needs: [ 'gemnasium-python-dependency_scanning', 'semgrep-sast', 'kics-iac-sast' ] + needs: ['gemnasium-python-dependency_scanning', 'semgrep-sast', 'kics-iac-sast'] image: name: jetbrains/qodana-python-community entrypoint: @@ -49,39 +49,21 @@ coverage: - qodana-2023.3- paths: - ".qodana/cache" + - $CI_PROJECT_DIR/venv variables: QODANA_TOKEN: "$qodana_token2" + before_script: + - cd $CI_PROJECT_DIR/ + - python -m venv venv + - chmod u+x venv/bin/activate + - source venv/bin/activate script: - - qodana --save-report --results-dir=$CI_PROJECT_DIR/.qodana/results --cache-dir=$CI_PROJECT_DIR/.qodana/cache --coverage-dir=$CI_PROJECT_DIR/coverage - artifacts: - expose_as: 'Coverage' - expire_in: 1 week - paths: - - ".qodana/coverage/" - -qodana: - stage: 'code_quality' - needs: ['gemnasium-python-dependency_scanning', 'semgrep-sast', 'kics-iac-sast'] - image: - name: jetbrains/qodana-python-community - entrypoint: - - '' - cache: - - key: qodana-2023.3-$CI_DEFAULT_BRANCH-$CI_COMMIT_REF_SLUG - fallback_keys: - - qodana-2023.3-$CI_DEFAULT_BRANCH- - - qodana-2023.3- - paths: - - ".qodana/cache" - variables: - QODANA_TOKEN: "$qodana_token2" - script: - - qodana --save-report --results-dir=$CI_PROJECT_DIR/.qodana/results --cache-dir=$CI_PROJECT_DIR/.qodana/cache + - qodana --save-report --results-dir=$CI_PROJECT_DIR/.qodana/results --cache-dir=$CI_PROJECT_DIR/.qodana/cache artifacts: expose_as: 'Qodana report' expire_in: 1 week paths: - - ".qodana/results/" + - ".qodana/results/" push: diff --git a/qodana.yaml b/qodana.yaml index a4e4363..d6d847e 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,6 +1,7 @@ version: "1.0" bootstrap: | rm -rf .idea - pip install -U -r requirements.txt + + pip install --quiet -U -r requirements.txt profile: name: qodana.recommended