Merge branch 'chore/ci-run-automatically' into 'main'

Let CI jobs run automatically

See merge request cs108-fs26/Gruppe-13!20
This commit was merged in pull request #176.
This commit is contained in:
Lars Simon Winzer
2026-03-14 09:40:36 +01:00
+37 -5
View File
@@ -11,9 +11,38 @@ stages:
- .gradle/ - .gradle/
- ~/.gradle/caches/ - ~/.gradle/caches/
.on-commit: &on-commit
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_COMMIT_BRANCH'
allow_failure: true
.on-mr: &on-mr
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
allow_failure: true # deactivate after all issues (shown by checkstyle) have been resolved
# Jobs # Jobs
checkstyle: checkstyle:
<<: *gradle-cache <<: [*gradle-cache, *on-commit]
stage: lint
image: gradle:9.3.1-jdk25
script:
- gradle checkstyleMain checkstyleTest
allow_failure: true
artifacts:
when: always
paths:
- build/reports/checkstyle/main.html
- build/reports/checkstyle/main.xml
- build/reports/checkstyle/test.html
- build/reports/checkstyle/test.xml
expose_as: 'Checkstyle Report'
expire_in: 1 week
checkstyle-mr:
<<: [*gradle-cache, *on-mr]
stage: lint stage: lint
image: gradle:9.3.1-jdk25 image: gradle:9.3.1-jdk25
script: script:
@@ -28,16 +57,16 @@ checkstyle:
- build/reports/checkstyle/test.xml - build/reports/checkstyle/test.xml
expose_as: 'Checkstyle Report' expose_as: 'Checkstyle Report'
expire_in: 1 week expire_in: 1 week
rules:
- when: manual
checkstyle-report: checkstyle-report:
stage: report stage: report
image: python:3.14 image: python:3.14
needs: needs:
- job: checkstyle - job: checkstyle-mr
artifacts: true artifacts: true
optional: true optional: true
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
script: script:
- python3 scripts/convert-checkstyle-gl-report.py - python3 scripts/convert-checkstyle-gl-report.py
artifacts: artifacts:
@@ -54,4 +83,7 @@ compile-check:
- gradle compileTestJava - gradle compileTestJava
needs: [] needs: []
rules: rules:
- when: manual - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
allow_failure: false
- if: '$CI_COMMIT_BRANCH'
allow_failure: false