-
Notifications
You must be signed in to change notification settings - Fork 32
69 lines (69 loc) · 2.27 KB
/
gradle.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
name: Test Guides
on:
push:
branches:
- master
- '[1-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[1-9]+.[0-9]+.x'
jobs:
test_matrix:
name: Generate Guide Test Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.test_matrix_step.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Generate Guide Test Matrix
id: test_matrix_step
run: |
echo "Searching for groups..."
gradleTasks=$(./gradlew tasks | grep "Run group of guide tests" | sed 's/\(.*\) - Run group of guide tests/\"\1\"/' | tr '\n' ',' | sed 's/.$//')
tasksEntry="\"group_test_tasks\":[$(echo $gradleTasks)]"
matrixValue="{$(echo $tasksEntry)}"
echo "Created matrix: $matrixValue"
echo "matrix=$matrixValue" >> $GITHUB_OUTPUT
alltests:
name: Running ${{ matrix.group }} with Java ${{ matrix.java }}
needs: test_matrix
runs-on: ubuntu-latest
strategy:
matrix:
java: ["17", "21"]
group: ${{ fromJson(needs.test_matrix.outputs.matrix).group_test_tasks }}
env:
JDK_VERSION: ${{ matrix.java }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Run All Guide Tests
run: './gradlew ${{ matrix.group }}'
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}