1
- name : Test SNAPSHOT
1
+ name : Test SNAPSHOT Guides
2
2
on :
3
3
schedule :
4
4
- cron : ' 0 5 * * 1-5'
5
+ workflow_dispatch :
5
6
jobs :
7
+ test_matrix :
8
+ name : Generate Guide Test Matrix
9
+ runs-on : ubuntu-latest
10
+ outputs :
11
+ matrix : ${{ steps.test_matrix_step.outputs.matrix }}
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+ - name : Set up JDK
15
+ uses : actions/setup-java@v4
16
+ with :
17
+ distribution : ' adopt'
18
+ java-version : ' 17'
19
+ - uses : actions/cache@v3
20
+ with :
21
+ path : ~/.gradle/caches
22
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
23
+ restore-keys : |
24
+ ${{ runner.os }}-gradle-
25
+ - name : Generate Guide Test Matrix
26
+ id : test_matrix_step
27
+ run : |
28
+ echo "Searching for groups..."
29
+ gradleTasks=$(./gradlew tasks | grep "Run group of guide tests" | sed 's/\(.*\) - Run group of guide tests/\"\1\"/' | tr '\n' ',' | sed 's/.$//')
30
+ tasksEntry="\"group_test_tasks\":[$(echo $gradleTasks)]"
31
+ matrixValue="{$(echo $tasksEntry)}"
32
+ echo "Created matrix: $matrixValue"
33
+ echo "matrix=$matrixValue" >> $GITHUB_OUTPUT
6
34
alltests :
35
+ name : Running SNAPSHOT ${{ matrix.group }} with Java ${{ matrix.java }}
36
+ needs : test_matrix
7
37
runs-on : ubuntu-latest
8
38
strategy :
9
39
matrix :
10
40
java : ["17", "21"]
41
+ group : ${{ fromJson(needs.test_matrix.outputs.matrix).group_test_tasks }}
11
42
env :
12
43
JDK_VERSION : ${{ matrix.java }}
13
44
steps :
14
- - uses : actions/checkout@v2
45
+ - uses : actions/checkout@v4
15
46
with :
16
47
fetch-depth : 0
17
- - uses : actions/cache@v2
48
+ - uses : actions/cache@v3
18
49
with :
19
50
path : ~/.gradle/caches
20
51
key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
21
52
restore-keys : |
22
53
${{ runner.os }}-gradle-
23
54
- name : Set up JDK
24
- uses : actions/setup-java@v1
55
+ uses : actions/setup-java@v4
25
56
with :
57
+ distribution : ' adopt'
26
58
java-version : ${{ matrix.java }}
27
59
- name : Use next snapshot patch version
28
60
run : ./increment_version.sh -p
29
61
- name : Run All Guide Tests
30
- run : ' ./gradlew runAllGuideTests '
62
+ run : ' ./gradlew ${{ matrix.group }} '
31
63
env :
32
- AWS_ACCESS_KEY_ID : XXX
33
- AWS_SECRET_ACCESS_KEY : YYY
34
- AWS_REGION : us-east-1
35
64
GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
36
65
GRADLE_ENTERPRISE_CACHE_USERNAME : ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
37
66
GRADLE_ENTERPRISE_CACHE_PASSWORD : ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
0 commit comments