Skip to content

Commit

Permalink
fix: split pylint and pytest jobs, rename build jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Syakyr committed Oct 2, 2024
1 parent 865c3ff commit 35415d8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
35 changes: 29 additions & 6 deletions {{cookiecutter.repo_name}}/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,32 @@ test:conda-build:
when: never
needs: []

test:pylint-pytest:
test:pylint:
stage: test
before_script:
- source activate ./conda/{{cookiecutter.repo_name}}
- pip install -r dev-requirements.txt
script:
- pylint src --fail-under=7.0 --ignore=tests --disable=W1202
rules:
- if: $CI_MERGE_REQUEST_IID
changes:
- src/**/*
- conf/**/*
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_TAG
when: never
needs:
- job: test:conda-build
optional: true

test:pytest:
stage: test
before_script:
- source activate ./conda/{{cookiecutter.repo_name}}
- pip install -r dev-requirements.txt
script:
- pytest src/tests --junitxml=./rspec.xml
rules:
- if: $CI_MERGE_REQUEST_IID
Expand Down Expand Up @@ -119,10 +138,12 @@ build:cpu-image:
- if: $CI_PIPELINE_SOURCE == "web" && $BUILD_ALL
- if: $CI_PIPELINE_SOURCE == "web" && $BUILD_DATAPREP
needs:
- job: test:pylint-pytest
- job: test:pytest
optional: true
- job: test:pylint
optional: true

build:model-training-image:
build:gpu-image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
Expand Down Expand Up @@ -159,7 +180,9 @@ build:model-training-image:
- if: $CI_PIPELINE_SOURCE == "web" && $BUILD_ALL
- if: $CI_PIPELINE_SOURCE == "web" && $BUILD_MODEL
needs:
- job: test:pylint-pytest
- job: test:pytest
optional: true
- job: test:pylint
optional: true

build:retag-images:
Expand Down Expand Up @@ -192,7 +215,7 @@ build:retag-images:
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
needs:
- job: build:data-prep-image
- job: build:cpu-image
optional: true
- job: build:model-training-image
- job: build:gpu-image
optional: true
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
- python=3.12.4
- pip=24.2
- pip:
- -r requirements.txt
- -r requirements.txt

0 comments on commit 35415d8

Please sign in to comment.