forked from akhikhl/gretty
-
Notifications
You must be signed in to change notification settings - Fork 36
113 lines (89 loc) · 3.26 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
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: "17"
GRADLE_VERSION: "7.6.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: 11
gradle: '7.6.4'
- java: 11
gradle: '7.6.4'
toolchainJavaVersion: 17
- java: 17
gradle: '7.6.4'
- java: 17
gradle: '7.6.4'
toolchainJavaVersion: 21
- java: 17
gradle: '8.6'
- java: 17
gradle: '8.6'
toolchainJavaVersion: 21
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 }}
- 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
# begin workaround - see also integrationTests/buildSrc/build.gradle
- name: Install buildSrc project (only required for Gradle 8)
run: |
../../gradlew --no-daemon \
--warning-mode all \
-PprivateRepoDir=$PRIVATE_REPO \
publishToPrivateRepo
if: "startsWith(env.GRADLE_VERSION, '8.')"
working-directory: integrationTests/buildSrc
# end workaround
- 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