Verified Commit 54b67e7f authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Update Gitlab-CI pre-commit job

parent 70a72256
Loading
Loading
Loading
Loading
Loading
−58

File deleted.

+6 −18
Changes for .gitlab-ci.yml: 6 added lines, 18 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
# SAFETY_API_KEY:
#   Set to your API key for accessing up-to-date package security information

variables:
  PRE_COMMIT_TAG: 4.5.1-py3.11

workflow:
  rules:
@@ -15,6 +17,10 @@ workflow:
  - if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/
  - if: $CI_COMMIT_BRANCH

include:
- project: dom/project-templates
  file: /pipeline-templates/pre-commit.yml


.python:
  image: python:3.10
@@ -59,24 +65,6 @@ Dependency Check:
  - safety check -r requirements.txt


Code Checks:
  stage: .pre
  image: docker.kodo.org.uk/ci-images/pre-commit:2.15.0-1
  needs: []
  variables:
    PRE_COMMIT_HOME: $CI_PROJECT_DIR/cache/pre-commit
  cache:
    key: $CI_JOB_IMAGE
    paths: [cache]
  rules:
  - if: $CI_PIPELINE_SOURCE == "push"
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  script:
  - source .gitlab-ci.pre-commit-run.bash
  - pre_commit_run --hook-stage=commit
  - pre_commit_run --hook-stage=push


Unit Tests:
  stage: test
  extends: [.python]