Skip to content

Commit

Permalink
feat: use gitlab changes rule to control analyse execution
Browse files Browse the repository at this point in the history
  • Loading branch information
jackd248 committed Aug 12, 2024
1 parent 50d7488 commit 3a13cc4
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ stages:
.base-analyse:
stage: analyse
extends: .feature-branches
except:
- schedules
- pipelines
- tags
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_PIPELINE_SOURCE == "pipeline"'
when: never
- if: '$CI_COMMIT_TAG'
when: never

#-----------------------------------------------------------------------------------------------------------------------
# BUILD
Expand Down
4 changes: 4 additions & 0 deletions analyse/analyse-composer-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
analyse:composer:lint:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/composer.json"
- "**/composer.lock"
script:
- composer run composer:normalize:check -d ${PATH_APP_DIR}
3 changes: 3 additions & 0 deletions analyse/analyse-php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
analyse:php:cs-fixer:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/*.php"
script:
- composer run php:cs-fixer:check -d ${PATH_APP_DIR}
3 changes: 3 additions & 0 deletions analyse/analyse-php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
analyse:php:lint:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/*.php"
script:
- composer run php:lint -d ${PATH_APP_DIR}
3 changes: 3 additions & 0 deletions analyse/analyse-php-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
analyse:php:rector:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/*.php"
script:
- composer run php:rector:check -d ${PATH_APP_DIR}
3 changes: 3 additions & 0 deletions analyse/analyse-php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
analyse:php:stan:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/*.php"
script:
- composer run php:stan:check -d ${PATH_APP_DIR}
5 changes: 5 additions & 0 deletions analyse/analyse-typoscript-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
analyse:typoscript:lint:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/*.typoscript"
- "**/*.tsconfig"
- "**/Configuration/**/*.ts"
script:
- composer run typoscript:lint -d ${PATH_APP_DIR}
3 changes: 3 additions & 0 deletions analyse/analyse-xml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
analyse:xml:lint:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- changes:
- "**/*.xlf"
script:
- apt-get update -qq && apt-get install libxml2-utils -qq
- composer run xml:lint -d ${PATH_APP_DIR}
5 changes: 5 additions & 0 deletions analyse/analyse-yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
analyse:yaml:lint:
needs: [ "build:php" ]
extends: .base-analyse
rules:
- if
- changes:
- "**/*.yml"
- "**/*.yaml"
script:
- composer run yaml:lint -d ${PATH_APP_DIR}

0 comments on commit 3a13cc4

Please sign in to comment.