-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
102 lines (90 loc) · 2.73 KB
/
.gitlab-ci.yml
File metadata and controls
102 lines (90 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
variables:
DEBIAN_FRONTEND: noninteractive
GRADLE_ARGS: --no-daemon --stacktrace --warning-mode=all
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
cache:
paths:
- .gradle/caches
- .gradle/notifications
- .gradle/wrapper
# For testing with older Java versions.
# Gradle 9 requires at least Java 17 to run,
# but can still compile/test using older JDKs if requested via a toolchain configuration.
# Thus, if the Java version provided by the eclipse-temurin image in question is too old to run Gradle,
# we additionally install Ubuntu's default JRE,
# which should always be new enough to run current Gradle versions.
# For example, as of 2025-11,
# the eclipse-temurin:8 image is based on Ubuntu 24.04 LTS (noble),
# whose default Java version is Java 21.
# Jobs that extend this template must also set the environment variable ORG_GRADLE_PROJECT_javaToolchainVersion
# to the Java version number of the eclipse-temurin image.
.linux_old_java:
variables:
# Change JAVA_HOME to the system default Java
# so that Gradle runs using this newer Java version.
JAVA_HOME: "/usr/lib/jvm/default-java"
before_script:
- apt-get update
- apt-get install -y default-jre-headless git
.linux_new_java:
before_script:
- apt-get update
- apt-get install -y git
.tests:
stage: test
script: ./gradlew ${GRADLE_ARGS} check
artifacts:
reports:
junit:
- "build/test-results/**/TEST-*.xml"
tests:jdk-8:
extends:
- .linux_old_java
- .tests
image: eclipse-temurin:8
variables:
ORG_GRADLE_PROJECT_javaToolchainVersion: "8"
tests:jdk-11:
extends:
- .linux_old_java
- .tests
image: eclipse-temurin:11
variables:
ORG_GRADLE_PROJECT_javaToolchainVersion: "11"
tests:jdk-17:
extends:
- .linux_new_java
- .tests
image: eclipse-temurin:17
tests:jdk-21:
extends:
- .linux_new_java
- .tests
image: eclipse-temurin:21
tests:jdk-25:
extends:
- .linux_new_java
- .tests
image: eclipse-temurin:25
tests:macos:
extends: .tests
tags:
- macos
tests:windows64:
extends: .tests
script: cmd /c ".\gradlew.bat %GRADLE_ARGS% check"
tags:
- windows
publish:
extends: .linux_old_java
stage: deploy
image: eclipse-temurin:8
variables:
ORG_GRADLE_PROJECT_javaToolchainVersion: "8"
script:
- openssl aes-256-cbc -d -base64 -pbkdf2 -pass "env:ENCRYPTION_PASSWORD" -in gradle.properties.enc -out gradle.properties
- openssl aes-256-cbc -d -base64 -pbkdf2 -pass "env:ENCRYPTION_PASSWORD" -in pubring.gpg.enc -out pubring.gpg
- openssl aes-256-cbc -d -base64 -pbkdf2 -pass "env:ENCRYPTION_PASSWORD" -in secring.gpg.enc -out secring.gpg
- ./gradlew ${GRADLE_ARGS} publish closeStagingRepositories
only:
- master@stups/prob/antlr_b_parser