-
Notifications
You must be signed in to change notification settings - Fork 65
173 lines (165 loc) · 6.16 KB
/
test-native-gradle-plugin.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: "Test native-gradle-plugin"
on:
push:
paths:
- 'native-gradle-plugin/**'
- 'samples/**'
- 'common/**'
- '.github/actions/**'
- '.github/workflows/test-native-gradle-plugin.yml'
- 'gradle/libs.versions.toml'
pull_request:
paths:
- 'native-gradle-plugin/**'
- 'samples/**'
- 'common/**'
- '.github/actions/**'
- '.github/workflows/test-native-gradle-plugin.yml'
- 'gradle/libs.versions.toml'
workflow_dispatch:
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/native-build-tools' }}
jobs:
populate-matrix:
name: "Set matrix"
runs-on: "ubuntu-20.04"
timeout-minutes: 5
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v3
- name: "🔧 Prepare environment"
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "🕸️ Populate matrix"
id: set-matrix
run: ./gradlew -PmatrixType=gradle :native-gradle-plugin:dumpFunctionalTestList
functional-testing-gradle-plugin:
name: "🧪 Gradle: ${{ matrix.test }} on ${{ matrix.os }} with gradle version: ${{ matrix.gradle-version }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: populate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.populate-matrix.outputs.matrix)}}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Prepare environment"
uses: ./.github/actions/prepare-environment
with:
java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "❓ Check and test the plugin"
run: ./gradlew :native-gradle-plugin:functionalTest -DgradleVersion="${{ matrix.gradle-version }}" --tests ${{ matrix.test }}
- name: "📜 Upload functional tests results"
if: always()
uses: actions/upload-artifact@v3
with:
name: functional-tests-results-${{ matrix.gradle-version }}
path: native-gradle-plugin/build/reports/tests/functionalTest/
populate-cache-matrix:
name: "Set cache matrix"
runs-on: "ubuntu-20.04"
timeout-minutes: 5
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v3
- name: "🔧 Prepare environment"
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "🕸️ Populate matrix"
id: set-matrix
run: |
./gradlew -PmatrixType=gradleCached :native-gradle-plugin:dumpFunctionalTestList
functional-testing-gradle-with-cache-version:
name: "🧪 Gradle: ${{ matrix.test }} on ${{ matrix.os }} with cache gradle version: ${{ matrix.gradle-config-cache-version }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: populate-cache-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.populate-cache-matrix.outputs.matrix)}}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Prepare environment"
uses: ./.github/actions/prepare-environment
with:
java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "❓ Check and test the plugin with configuration cache"
run: ./gradlew :native-gradle-plugin:configCacheFunctionalTest -DgradleVersion="${{ matrix.gradle-config-cache-version }}" --tests ${{ matrix.test }}
- name: "📜 Upload functional tests results"
if: always()
uses: actions/upload-artifact@v3
with:
name: functional-tests-results-${{ matrix.gradle-config-cache-version }}
path: native-gradle-plugin/build/reports/tests/functionalTest/
test-native-gradle-plugin:
name: "Sanity checks"
runs-on: "ubuntu-20.04"
timeout-minutes: 50
strategy:
fail-fast: false
matrix:
java-version: [ 17 ]
os: [ ubuntu-20.04 ]
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Prepare environment"
uses: ./.github/actions/prepare-environment
with:
java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "❓ Unit tests and inspections"
run: ./gradlew :native-gradle-plugin:test :native-gradle-plugin:inspections
- name: "📜 Upload unit test results"
uses: actions/upload-artifact@v3
with:
name: unit-tests-results
path: native-gradle-plugin/build/reports/tests/test/
functional-testing-gradle-plugin-dev:
name: "Functional testing (GraalVM Dev Build)"
runs-on: ${{ matrix.os }}
env:
IS_GRAALVM_DEV_BUILD: 'true'
strategy:
fail-fast: false
matrix:
java-version: [ 17 ]
os: [ ubuntu-20.04 ]
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Prepare environment"
uses: ./.github/actions/prepare-environment
with:
java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "🔧 Install GraalVM (dev)"
uses: graalvm/setup-graalvm@main
with:
java-version: 'dev'
distribution: 'graalvm'
github-token: ${{ inputs.github-token }}
set-java-home: 'false'
- name: "❓ Check and test the plugin"
run: ./gradlew :native-gradle-plugin:functionalTest
- name: "📜 Upload functional tests results"
if: always()
uses: actions/upload-artifact@v3
with:
name: functional-tests-results-graalvm-dev
path: native-gradle-plugin/build/reports/tests/functionalTest/