114 lines
2.9 KiB
YAML
114 lines
2.9 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
|
|
|
|
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
|