Skip to content

Commit a2ce8e7

Browse files
committed
Split jobs for gradle testing to avoid duplications
1 parent a0529f3 commit a2ce8e7

File tree

3 files changed

+44
-47
lines changed

3 files changed

+44
-47
lines changed

.github/workflows/test-native-gradle-plugin.yml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: "🕸️ Populate matrix"
4141
id: set-matrix
4242
run: |
43-
./gradlew :native-gradle-plugin:dumpFunctionalTestList
43+
./gradlew -PmatrixType=gradle :native-gradle-plugin:dumpFunctionalTestList
4444
4545
test-native-gradle-plugin:
4646
name: "Sanity checks"
@@ -118,38 +118,53 @@ jobs:
118118
github-token: ${{ secrets.GITHUB_TOKEN }}
119119
- name: "❓ Check and test the plugin"
120120
run: ./gradlew :native-gradle-plugin:functionalTest -DgradleVersion=${{ matrix.gradle-version }} --tests ${{ matrix.test }}
121-
- name: "❓ Check and test the plugin with configuration cache"
122-
run: ./gradlew :native-gradle-plugin:configCacheFunctionalTest -DgradleVersion=${{ matrix.gradle-config-cache-version }} --tests ${{ matrix.test }}
123121
- name: "📜 Upload functional tests results"
124122
if: always()
125123
uses: actions/upload-artifact@v2
126124
with:
127125
name: functional-tests-results-${{ matrix.gradle-version }}
128126
path: native-gradle-plugin/build/reports/tests/functionalTest/
129-
130-
functional-testing-gradle-plugin-windows:
131-
name: "Windows Gradle plugin functional testing"
132-
if: ${{ false }}
133-
# Disabled due to https://github.com/gradle/native-platform/issues/274
134-
needs: populate-matrix
127+
128+
populate-cache-matrix:
129+
name: "Set cache matrix"
130+
runs-on: "ubuntu-20.04"
131+
timeout-minutes: 5
132+
outputs:
133+
matrix: ${{ steps.set-matrix.outputs.matrix }}
134+
steps:
135+
- name: "☁️ Checkout repository"
136+
uses: actions/checkout@v3
137+
- name: "🔧 Prepare environment"
138+
uses: graalvm/setup-graalvm@v1
139+
with:
140+
java-version: '17'
141+
distribution: 'graalvm'
142+
github-token: ${{ secrets.GITHUB_TOKEN }}
143+
- name: "🕸️ Populate matrix"
144+
id: set-matrix
145+
run: |
146+
./gradlew -PmatrixType=gradleCached :native-gradle-plugin:dumpFunctionalTestList
147+
148+
functional-testing-gradle-with-cache-version:
149+
name: "🧪 Gradle: ${{ matrix.test }} on ${{ matrix.os }} with cache gradle version: ${{ matrix.gradle-config-cache-version }}"
135150
runs-on: ${{ matrix.os }}
151+
timeout-minutes: 60
152+
needs: populate-cache-matrix
136153
strategy:
137154
fail-fast: false
138-
matrix:
139-
java-version: [ 17 ]
140-
os: [ windows-latest ]
155+
matrix: ${{fromJson(needs.populate-cache-matrix.outputs.matrix)}}
141156
steps:
142157
- name: "☁️ Checkout repository"
143158
uses: actions/checkout@v3
144159
- uses: ./.github/actions/prepare-environment
145160
with:
146161
java-version: ${{ matrix.java-version }}
147162
github-token: ${{ secrets.GITHUB_TOKEN }}
148-
- name: "❓ Check and test the Gradle plugin"
149-
run: ./gradlew :native-gradle-plugin:functionalTest --no-daemon --fail-fast
150-
- name: "📜 Upload tests results"
163+
- name: "❓ Check and test the plugin with configuration cache"
164+
run: ./gradlew :native-gradle-plugin:configCacheFunctionalTest -DgradleVersion=${{ matrix.gradle-config-cache-version }} --tests ${{ matrix.test }}
165+
- name: "📜 Upload functional tests results"
151166
if: always()
152-
uses: actions/upload-artifact@v3
167+
uses: actions/upload-artifact@v2
153168
with:
154-
name: windows-gradle-functional-tests-results
155-
path: native-gradle-plugin/build/reports/tests/
169+
name: functional-tests-results-${{ matrix.gradle-config-cache-version }}
170+
path: native-gradle-plugin/build/reports/tests/functionalTest/

.github/workflows/test-native-maven-plugin.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: "🕸️ Populate matrix"
4141
id: set-matrix
4242
run: |
43-
./gradlew :native-maven-plugin:dumpFunctionalTestList
43+
./gradlew -PmatrixType=maven :native-maven-plugin:dumpFunctionalTestList
4444
4545
test-native-maven-plugin:
4646
name: "🧪 Maven: ${{ matrix.test }} on ${{ matrix.os }}"
@@ -65,28 +65,3 @@ jobs:
6565
with:
6666
name: maven-functional-tests-results-${{ matrix.os }}
6767
path: native-maven-plugin/build/reports/tests/
68-
test-native-maven-plugin-windows:
69-
name: "Windows Minimal Tests for Maven plugin"
70-
if: ${{ false }}
71-
# Fails with "Illegal char <�> at index 3: C:\�Users\�RUNNER~1\�AppData\�Local\�Temp\�spock_supports_spaces_in__0_testDirectory18198684407774777428\�with spaces\�local-repo\�org\�apache\�commons\�commons-lang3\�3.8.1\�commons-lang3-3.8.1.jar"
72-
runs-on: ${{ matrix.os }}
73-
strategy:
74-
fail-fast: false
75-
matrix:
76-
java-version: [ 17 ]
77-
os: [ windows-latest ]
78-
steps:
79-
- name: "☁️ Checkout repository"
80-
uses: actions/checkout@v3
81-
- uses: ./.github/actions/prepare-environment
82-
with:
83-
java-version: ${{ matrix.java-version }}
84-
github-token: ${{ secrets.GITHUB_TOKEN }}
85-
- name: "❓ Check and test the Maven plugin"
86-
run: ./gradlew :native-maven-plugin:functionalTest --no-daemon --fail-fast
87-
- name: "📜 Upload tests results"
88-
if: always()
89-
uses: actions/upload-artifact@v3
90-
with:
91-
name: windows-maven-functional-tests-results
92-
path: native-maven-plugin/build/reports/tests/

build-logic/common-plugins/src/main/groovy/org.graalvm.build.github-actions-helper.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import groovy.json.JsonOutput
22

33
def matrixDefault = [
44
"java-version": [ "17" ],
5-
"os": [ "ubuntu-20.04" ]
5+
"os": [ "ubuntu-20.04", "windows-latest" ]
66
]
77

8+
// # Following versions are disabled temporarily in order to speed up PR testing "7.3.3", "7.2", "7.1", "6.8.3",
89
def gradleVersions = [
910
"gradle-version": ["current", "7.4"],
11+
]
12+
13+
def gradleCachedVersions = [
1014
"gradle-config-cache-version": ["current", "8.0.1"]
11-
// # Following versions are disabled temporarily in order to speed up PR testing "7.3.3", "7.2", "7.1", "6.8.3",
1215
]
1316

1417
sourceSets.configureEach { sourceSet ->
@@ -23,10 +26,14 @@ sourceSets.configureEach { sourceSet ->
2326
matrix.putAll(matrixDefault)
2427

2528
// add gradle specific stuff
26-
if (project.getDisplayName().contains(":native-gradle-plugin")) {
29+
if (matrixType == "gradle") {
2730
matrix.putAll(gradleVersions)
2831
}
2932

33+
if (matrixType == "gradleCached") {
34+
matrix.putAll(gradleCachedVersions)
35+
}
36+
3037
// add functional tests
3138
sourceSet.allSource.each {
3239
matrix.test << it.name.substring(0, it.name.lastIndexOf('.'))

0 commit comments

Comments
 (0)