Setup Code Analysis

This commit is contained in:
2022-04-29 13:43:06 +00:00
parent d2d81fefc4
commit 9a1e57a3a2
10 changed files with 383 additions and 65 deletions
+53 -10
View File
@@ -1,15 +1,58 @@
Create Application:
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- source "/home/gitlab-runner/.sdkman/bin/sdkman-init.sh"
- sdk u java 11.0.12-open
stages:
- build
- test
- analysis
- publish
Build Application:
stage: build
script:
- chmod +x gradlew
- ./gradlew --no-daemon build
script: ./gradlew --build-cache build
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle
Create Documentation:
stage: build
script:
- chmod +x gradlew
- ./gradlew --no-daemon asciidoctor
artifacts:
paths:
- build/docs/asciidocPdf/*.pdf
script: ./gradlew asciidoctorPdf
Test Application:
stage: test
script: ./gradlew check
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
sonarqube-check:
stage: analysis
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script: ./gradlew sonarqube
allow_failure: true
Publish Artifacts:
stage: publish
script: ./gradlew publish
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle