summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2026-01-14 22:04:21 +0200
committerGravatar Uko Kokņevičs2026-01-15 20:09:57 +0200
commitb68fcec29a5e90ea8c8c8482bdc66f48c79f2954 (patch)
tree98e950fef59cef34c0f57377275cb1d8b31d044c
parentAdd libyear-maven-plugin (diff)
downloadlv.enes:parent-b68fcec29a5e90ea8c8c8482bdc66f48c79f2954.tar.gz
lv.enes:parent-b68fcec29a5e90ea8c8c8482bdc66f48c79f2954.tar.xz
lv.enes:parent-b68fcec29a5e90ea8c8c8482bdc66f48c79f2954.zip
More CI improvements
-rw-r--r--.gitignore2
-rw-r--r--.gitlab-ci.yml72
2 files changed, 61 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 8a401cc..908ca94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,4 +39,4 @@ build/
39hs_err_* 39hs_err_*
40 40
41### GitLab CI ### 41### GitLab CI ###
42/.m2 42/.cache
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6df673d..8ca9feb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,42 +1,90 @@
1variables: 1variables:
2 M2_REPO: ".m2/repository" 2 XDG_CACHE_HOME: "${CI_PROJECT_DIR}/.cache"
3 MAVEN_OPTS: "-Dmaven.repo.local=$M2_REPO" 3 M2_REPO: "${XDG_CACHE_HOME}/m2/repository"
4 MAVEN_OPTS: "-Dmaven.repo.local=${M2_REPO}"
5 PRE_COMMIT_HOME: "${XDG_CACHE_HOME}/pre-commit"
4 6
5default: 7default:
6 image: registry.gitlab.com/lv.enes/containers/build-env:latest 8 image: registry.gitlab.com/lv.enes/containers/build-env:latest
7 cache: 9 cache:
8 paths: 10 paths:
9 - .m2/repository 11 - .cache/
10 - target/ 12 - target/
13 - buildstuffs/target/
11 14
12stages: 15stages:
16 - cache
13 - lint 17 - lint
14 - build 18 - build
19 - test
15 - deploy 20 - deploy
16 21
17pre-commit-job: 22cache-maven:
23 stage: cache
24 script:
25 - ./mvnw dependency:go-offline
26
27lint-pre-commit:
18 stage: lint 28 stage: lint
19 script: 29 script:
20 - pre-commit run -a 30 - pre-commit run -a
31 rules:
32 - if: $CI_PIPELINE_SOURCE != "schedule"
21 33
22build-repro-job: 34build:
23 stage: build 35 stage: build
36 script:
37 - ./mvnw install
38 rules:
39 - if: $CI_PIPELINE_SOURCE != "schedule"
40
41# Currently this one is just dependency-check, it didn't like my requests to populate the cache before, so leaving it
42# off for now...
43# test-all:
44# stage: test
45# script:
46# - ./mvnw verify -Denv=test
47
48test-libyear:
49 stage: test
50 script:
51 - ./mvnw verify -DmaxLibYears=1
52
53# NOTE: This one always fails when there's an update available
54test-pre-commit-update:
55 stage: test
56 artifacts:
57 paths:
58 - update.diff
59 when: on_failure
60 script:
61 - pre-commit autoupdate
62 - git diff --exit-code | tee update.diff
63
64test-repro:
65 stage: test
24 cache: 66 cache:
25 # This job deletes stuff from the maven repository to make sure it's reproducible, don't update the cache 67 # This job deletes stuff from the maven repository to make sure the parent is reproducible, don't update the cache
26 policy: pull 68 policy: pull
27 script: 69 script:
28 - ./build.sh 70 - ./build.sh
71 rules:
72 - if: $CI_PIPELINE_SOURCE != "schedule"
29 73
30# TODO: Should run owasp plugin but that beast is complaining about too many requests :confused: 74# NOTE: This one never fails on updates, that's left for test-libyear
31build-job: 75test-versions-update:
32 stage: build 76 stage: test
77 artifacts:
78 paths:
79 - update.diff
33 script: 80 script:
34 - ./mvnw verify 81 - ./mvnw versions:update-child-modules versions:update-parent versions:update-properties
82 - git diff | tee update.diff
35 83
36deploy-job: 84deploy:
37 stage: deploy 85 stage: deploy
38 environment: production 86 environment: production
39 script: 87 script:
40 - ./mvnw -s ci/mvn-settings.xml deploy 88 - ./mvnw -s ci/mvn-settings.xml deploy
41 rules: 89 rules:
42 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH 90 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"