diff options
Diffstat (limited to '.gitlab-ci.yml')
| -rw-r--r-- | .gitlab-ci.yml | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2fddc6d --- /dev/null +++ b/.gitlab-ci.yml | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | variables: | ||
| 2 | XDG_CACHE_HOME: "${CI_PROJECT_DIR}/.cache" | ||
| 3 | M2_REPO: "${XDG_CACHE_HOME}/m2/repository" | ||
| 4 | MAVEN_OPTS: "-Dmaven.repo.local=${M2_REPO}" | ||
| 5 | MAVEN_ARGS: "-s ${CI_PROJECT_DIR}/ci/mvn-settings.xml" | ||
| 6 | PRE_COMMIT_HOME: "${XDG_CACHE_HOME}/pre-commit" | ||
| 7 | |||
| 8 | default: | ||
| 9 | image: registry.gitlab.com/lv.enes/containers/build-env:latest | ||
| 10 | cache: | ||
| 11 | paths: | ||
| 12 | - .cache/ | ||
| 13 | - target/ | ||
| 14 | - buildstuffs/target/ | ||
| 15 | |||
| 16 | stages: | ||
| 17 | - cache | ||
| 18 | - lint | ||
| 19 | - build | ||
| 20 | - test | ||
| 21 | - deploy | ||
| 22 | |||
| 23 | # Can't do this, it tries to fetch buildstuffs which is outdated... | ||
| 24 | # cache-maven: | ||
| 25 | # stage: cache | ||
| 26 | # script: | ||
| 27 | # - ./mvnw dependency:go-offline | ||
| 28 | |||
| 29 | lint-pre-commit: | ||
| 30 | stage: lint | ||
| 31 | script: | ||
| 32 | - pre-commit run -a | ||
| 33 | rules: | ||
| 34 | - if: $CI_PIPELINE_SOURCE != "schedule" | ||
| 35 | |||
| 36 | build: | ||
| 37 | stage: build | ||
| 38 | script: | ||
| 39 | - ./mvnw install | ||
| 40 | rules: | ||
| 41 | - if: $CI_PIPELINE_SOURCE != "schedule" | ||
| 42 | |||
| 43 | # Currently this one is just dependency-check, it didn't like my requests to populate the cache before, so leaving it | ||
| 44 | # off for now... | ||
| 45 | # test-all: | ||
| 46 | # stage: test | ||
| 47 | # script: | ||
| 48 | # - ./mvnw verify -Denv=test | ||
| 49 | |||
| 50 | test-libyear: | ||
| 51 | stage: test | ||
| 52 | script: | ||
| 53 | - ./mvnw verify -DmaxLibYears=1 | ||
| 54 | |||
| 55 | # NOTE: This one always fails when there's an update available | ||
| 56 | test-pre-commit-update: | ||
| 57 | stage: test | ||
| 58 | artifacts: | ||
| 59 | paths: | ||
| 60 | - update.diff | ||
| 61 | when: on_failure | ||
| 62 | script: | ||
| 63 | - pre-commit autoupdate | ||
| 64 | - git diff --exit-code | tee update.diff | ||
| 65 | |||
| 66 | test-repro: | ||
| 67 | stage: test | ||
| 68 | cache: | ||
| 69 | # This job deletes stuff from the maven repository to make sure the parent is reproducible, don't update the cache | ||
| 70 | policy: pull | ||
| 71 | script: | ||
| 72 | - ./build.sh | ||
| 73 | rules: | ||
| 74 | - if: $CI_PIPELINE_SOURCE != "schedule" | ||
| 75 | |||
| 76 | # NOTE: This one never fails on updates, that's left for test-libyear | ||
| 77 | test-versions-update: | ||
| 78 | stage: test | ||
| 79 | artifacts: | ||
| 80 | paths: | ||
| 81 | - update.diff | ||
| 82 | script: | ||
| 83 | - ./mvnw versions:update-child-modules versions:update-parent versions:update-properties | ||
| 84 | - git diff | tee update.diff | ||
| 85 | |||
| 86 | deploy: | ||
| 87 | stage: deploy | ||
| 88 | environment: production | ||
| 89 | script: | ||
| 90 | - ./mvnw deploy | ||
| 91 | rules: | ||
| 92 | - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule" | ||