This repository has been archived on 2026-05-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-03-31 13:01:30 +02:00

122 lines
3.1 KiB
YAML

stages:
- lint
- report
- build
- test
# Reusable definitions
.gradle-cache: &gradle-cache
variables:
GRADLE_USER_HOME: '$CI_PROJECT_DIR/.gradle-home'
cache:
key: '$CI_PROJECT_ID-gradle'
paths:
- .gradle/
- .gradle-home/
.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: false
# Jobs
checkstyle:
<<: [*gradle-cache, *on-commit]
stage: lint
image: gradle:9.3.1-jdk25
script:
- gradle checkstyleMain checkstyleTest --configuration-cache --configuration-cache-problems=warn
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
image: gradle:9.3.1-jdk25
script:
- gradle checkstyleMain checkstyleTest --configuration-cache --configuration-cache-problems=warn
allow_failure: false
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-report:
stage: report
image: python:3.14
needs:
- job: checkstyle-mr
artifacts: true
optional: true
when: always
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
script:
- python3 scripts/convert-checkstyle-gl-report.py
artifacts:
when: always
reports:
codequality: gl-code-quality-report.json
expire_in: 1 week
compile-check:
<<: *gradle-cache
stage: build
image: gradle:9.3.1-jdk25
script:
- gradle compileTestJava --configuration-cache --configuration-cache-problems=warn
needs: []
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
allow_failure: false
- if: '$CI_COMMIT_BRANCH'
allow_failure: false
javadoc-check:
<<: [*gradle-cache, *on-mr]
stage: build
image: gradle:9.3.1-jdk25
script:
- gradle javaDoc --configuration-cache --configuration-cache-problems=warn
needs: []
test:
<<: *gradle-cache
stage: test
image: gradle:9.3.1-jdk25
script:
- gradle test --configuration-cache --configuration-cache-problems=warn
artifacts:
when: always
reports:
junit: build/test-results/test/*.xml
paths:
- build/reports/tests/test/
expose_as: 'Test Report'
expire_in: 1 week
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
allow_failure: false
- if: '$CI_COMMIT_BRANCH'
allow_failure: true