forked from akhikhl/gretty
-
Notifications
You must be signed in to change notification settings - Fork 36
126 lines (101 loc) · 4.29 KB
/
ci.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CI
on: ['push', 'pull_request']
env:
PRIVATE_REPO: "${{ github.workspace }}/build/githubActionGrettyPrivateRepository"
jobs:
build:
name: Build Gretty
runs-on: ubuntu-latest
env:
JDK_VERSION: "11"
GRADLE_VERSION: "6.9.4"
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.JDK_VERSION }}
- name: Build with Gradle ${{ env.GRADLE_VERSION }}
run: |
set -e
./gradlew --no-daemon wrapper --gradle-version $GRADLE_VERSION --distribution-type all
./gradlew --no-daemon --warning-mode all -PprivateRepoDir=$PRIVATE_REPO build
set +e
- uses: actions/upload-artifact@v3
with:
name: gretty-private-repository
path: ${{ env.PRIVATE_REPO }}
test:
name: Gradle ${{ matrix.gradle }} on Java ${{ matrix.java }}${{ matrix.toolchainJavaVersion && format(' (Java {0} Container)', matrix.toolchainJavaVersion) || '' }}
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
include:
- java: 8
gradle: '6.9.4'
container: "['jetty9.3','jetty9.4','tomcat85','tomcat9']"
- java: 8
gradle: '6.9.4'
container: "['jetty9.3','jetty9.4','tomcat85','tomcat9']"
toolchainJavaVersion: 17
- java: 11
gradle: '6.9.4'
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']"
- java: 11
gradle: '6.9.4'
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']"
toolchainJavaVersion: 17
- java: 17
gradle: '7.6.4'
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']"
properties: '-Pspock_version=2.3-groovy-3.0 -PgebVersion=5.1'
- java: 17
gradle: '7.6.4'
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']"
toolchainJavaVersion: 21
properties: '-Pspock_version=2.3-groovy-3.0 -PgebVersion=5.1'
# TODO: add a JDK-21 build but fix the following issue before that:
# groovy.lang.MissingPropertyException: Could not set unknown property 'classifier' for task ':libs:gretty:javadocJar' of type org.gradle.api.tasks.bundling.Jar
# https://github.com/gretty-gradle-plugin/gretty/actions/runs/7788654990/job/21238688742
env:
TEST_ALL_CONTAINERS: ${{ matrix.container }}
GRADLE_VERSION: ${{ matrix.gradle }}
EXTRA_PROPERTIES: ${{ matrix.properties }}
TOOLCHAIN_JAVA_ARGS: "${{ matrix.toolchainJavaVersion && format('-PtoolchainJavaVersion={0}', matrix.toolchainJavaVersion) || '' }}"
GRADLE_TEST_TASK: "${{ matrix.toolchainJavaVersion && 'testAllJavaToolchain' || 'testAll' }}"
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: gretty-private-repository
path: ${{ env.PRIVATE_REPO }}
# Begin workaround: because the current Gradle wrapper does not support Java 17,
# we use JDK 15 to bootstrap the appropriate Gradle version, and then proceed
# to use a recent version of Gradle and Java.
- name: Set up JDK 15
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15
- name: Bootstrap Gradle version
run: ./gradlew --no-daemon wrapper --gradle-version $GRADLE_VERSION --distribution-type all
# end workaround
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Set up Gradle ${{ matrix.gradle }}
run: ./gradlew --no-daemon wrapper --gradle-version $GRADLE_VERSION --distribution-type all
- name: Run Integration Tests
run: |
../gradlew --no-daemon \
--warning-mode all \
-PprivateRepoDir=$PRIVATE_REPO \
$EXTRA_PROPERTIES $TOOLCHAIN_JAVA_ARGS \
-PgeckoDriverPlatform=linux64 \
-PtestAllContainers=$TEST_ALL_CONTAINERS \
$GRADLE_TEST_TASK
working-directory: integrationTests