-
Notifications
You must be signed in to change notification settings - Fork 128
232 lines (223 loc) · 12.6 KB
/
TEST.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: TEST
on:
push:
branches: [ main, 'release/**' ]
pull_request:
branches: [ main, 'release/**' ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CI: true
SKIP_KORGE_SAMPLES: true
DISPLAY: ":99"
JAVA_VERSION: 11
JAVA_DISTRIBUTION: zulu
ENABLE_BENCHMARKS: false
jobs:
changes:
runs-on: ubuntu-latest
outputs:
testJvm: ${{ steps.filter.outputs.jvm == 'true' || steps.filter.outputs.all == 'true' }}
testJs: ${{ steps.filter.outputs.js == 'true' || steps.filter.outputs.all == 'true' }}
testWasm: ${{ steps.filter.outputs.wasm == 'true' || steps.filter.outputs.all == 'true' }}
testAndroid: ${{ steps.filter.outputs.android == 'true' || steps.filter.outputs.all == 'true' }}
testWindows: ${{ steps.filter.outputs.windows == 'true' || steps.filter.outputs.native == 'true' || steps.filter.outputs.all == 'true' || steps.filter.outputs.jvm == 'true' }}
testLinux: ${{ steps.filter.outputs.linux == 'true' || steps.filter.outputs.native == 'true' || steps.filter.outputs.all == 'true' || steps.filter.outputs.jvm == 'true' }}
testMacos: ${{ steps.filter.outputs.macos == 'true' || steps.filter.outputs.native == 'true' || steps.filter.outputs.all == 'true' || steps.filter.outputs.jvm == 'true' }}
testIos: ${{ steps.filter.outputs.ios == 'true' || steps.filter.outputs.native == 'true' || steps.filter.outputs.all == 'true' || steps.filter.outputs.jvm == 'true' }}
steps:
- uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request' }}
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
filters: |
all:
- '.github/workflows/TEST.yml'
- '**/build.gradle'
- '**/build.gradle.kts'
- '**/settings.gradle'
- '**/settings.gradle.kts'
- '**/buildSrc/**'
- '**/gradle/**'
- '**/src/**'
- '**/test/**'
jvm:
- '**/src@jvm*/**'
- '**/src@concurrent*/**'
- '**/test@jvm*/**'
- '**/test@concurrent*/**'
android:
- '**/AndroidManifest.xml'
- '**/src@android*/**'
- '**/src@jvmAndroid*/**'
- '**/src@concurrent*/**'
- '**/src@main/**'
- '**/test@android*/**'
- '**/test@jvmAndroid*/**'
- '**/test@concurrent*/**'
- '**/test@main/**'
js:
- '**/src@js*/**'
- '**/test@js*/**'
wasm:
- '**/src@wasm*/**'
- '**/test@wasm*/**'
native:
- '**/src@native*/**'
- '**/src@concurrent*/**'
- '**/test@native*/**'
- '**/test@concurrent*/**'
windows:
- '**/src@mingw*/**'
- '**/test@mingw*/**'
linux:
- '**/src@linux*/**'
- '**/src@posix*/**'
- '**/test@linux*/**'
- '**/test@posix*/**'
macos:
- '**/src@apple*/**'
- '**/src@macos*/**'
- '**/src@darwin*/**'
- '**/src@posix*/**'
- '**/test@apple*/**'
- '**/test@macos*/**'
- '**/test@darwin*/**'
- '**/test@posix*/**'
ios:
- '**/src@apple*/**'
- '**/src@ios*/**'
- '**/src@tvos*/**'
- '**/src@darwin*/**'
- '**/src@posix*/**'
- '**/test@apple*/**'
- '**/test@ios*/**'
- '**/test@tvos*/**'
- '**/test@darwin*/**'
- '**/test@posix*/**'
test-jvm:
needs: changes
if: ${{ needs.changes.outputs.testJvm == 'true' }}
timeout-minutes: 240
runs-on: ubuntu-latest
env:
DISABLE_JAVASCRIPT_TEST: true
DISABLE_ANDROID: true
steps:
- { uses: actions/checkout@v3 }
- { name: Configure local.properties, run: "echo org.gradle.parallel=true >> local.properties" }
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Install freeglut3 & openal, run: sudo apt-get update && sudo apt-get -y install freeglut3-dev libopenal-dev xvfb }
- { name: Run Xvfb in Background, run: "Xvfb :99 &" }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- { name: Start gradle, run: ./gradlew --stacktrace }
- { name: Building classes, run: ./gradlew --stacktrace --parallel compileTestKotlinJvm }
- { name: Testing JVM, run: "./gradlew --stacktrace --parallel jvmTest", env: { EGL_LOG_LEVEL: debug, LIBGL_DEBUG: verbose, LIBGL_ALWAYS_SOFTWARE: true, MESA_DEBUG: true } }
- { name: Archive Test Results, if: failure(), uses: actions/upload-artifact@v3, with: { name: screenshot-test-results-linux, retention-days: 21, path: "**/build/reports", if-no-files-found: ignore } }
- { name: Check sandbox compiles, run: "./gradlew :korge-sandbox:jvmJar" }
- { name: Publish to maven local, run: ./gradlew --parallel publishJvmLocal publishKotlinMultiplatformPublicationToMavenLocal }
- { name: e2e test, working-directory: e2e/e2e-test, run: ./gradlew checkReferencesJvm --stacktrace }
- { name: Archive E2E Test Results, if: failure(), uses: actions/upload-artifact@v3, with: { name: e2e-test-results-linux-jvm, retention-days: 21, path: "**/e2e/e2e-test/build/screenshots", if-no-files-found: ignore } }
- { name: e2e multi test and hotreload, working-directory: e2e/e2e-test-multi, run: "./gradlew --watch-fs --warn --configuration-cache --configuration-cache-problems=warn compileKotlinJvm" }
- { name: e2e multi test runJvmAutoreload, working-directory: e2e/e2e-test-multi, run: "./gradlew --configuration-cache :client:runJvmAutoreload" }
- { name: Check publication includes iOS, run: ./gradlew checkModulePublication }
test-jvm-macos:
needs: changes
if: ${{ needs.changes.outputs.testMacos == 'true' }}
timeout-minutes: 240
runs-on: macos-11
env:
DISABLE_JAVASCRIPT_TEST: true
DISABLE_ANDROID: true
DISABLE_SANDBOX: true
steps:
- { uses: actions/checkout@v3 }
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- { name: Start gradle, run: ./gradlew }
- { name: Testing JVM on MacosX64, run: ./gradlew jvmTest }
- { name: Archive Test Results, if: failure(), uses: actions/upload-artifact@v3, with: { name: screenshot-test-results-macos, retention-days: 21, path: "**/build/reports", if-no-files-found: ignore } }
test-jvm-windows:
needs: changes
if: ${{ needs.changes.outputs.testWindows == 'true' }}
timeout-minutes: 240
runs-on: windows-latest
env:
DISABLE_JAVASCRIPT_TEST: true
DISABLE_KOTLIN_NATIVE: true
DISABLE_ANDROID: true
DISABLE_SANDBOX: true
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process -Dorg.gradle.workers.max=3
steps:
- { uses: actions/checkout@v3 }
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Configure local.properties, run: "echo org.gradle.parallel=false >> local.properties" }
- { name: Download, shell: cmd, run: "curl -L -o opengl32-x64.zip https://github.com/korlibs/mesa-dist-win/releases/download/21.2.3/opengl32-x64.zip" }
- { name: unzip, shell: cmd, run: "unzip opengl32-x64.zip" }
- { name: unzip to korge, shell: cmd, run: "unzip opengl32-x64.zip -d korge" }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- { name: Testing JVM on windows, shell: cmd, run: "CALL gradlew.bat --parallel jvmTest", env: { EGL_LOG_LEVEL: debug, LIBGL_DEBUG: verbose, LIBGL_ALWAYS_SOFTWARE: true, MESA_DEBUG: true } }
- { name: Archive Test Results, if: failure(), uses: actions/upload-artifact@v3, with: { name: screenshot-test-results-windows, retention-days: 21, path: "**/build/reports", if-no-files-found: ignore } }
test-js-wasm:
needs: changes
if: ${{ needs.changes.outputs.testJs == 'true' || needs.changes.outputs.testWasm == 'true' }}
timeout-minutes: 240
runs-on: ubuntu-latest
env:
DISABLE_KOTLIN_NATIVE: true
DISABLE_ANDROID: true
DISABLE_SANDBOX: true
steps:
- { uses: actions/checkout@v3 }
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Install freeglut3 & openal, run: sudo apt-get update && sudo apt-get -y install freeglut3-dev libopenal-dev }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- { name: Compile WASM, run: ./gradlew --parallel compileTestKotlinWasmJs }
- { name: Test WASM JS, run: ./gradlew --parallel wasmJsBrowserTest }
- { name: Test JS, run: ./gradlew --parallel jsNodeTest jsBrowserTest }
test-android:
needs: changes
if: ${{ needs.changes.outputs.testAndroid == 'true' }}
timeout-minutes: 240
#runs-on: macos-11
runs-on: ubuntu-latest
env:
DISABLE_KOTLIN_NATIVE: true
DISABLE_SANDBOX: true
steps:
- { uses: actions/checkout@v3 }
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- name: Run Android Connected Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 21
script: ./gradlew connectedCheck
test-ios:
needs: changes
if: ${{ needs.changes.outputs.testMacos == 'true' }}
timeout-minutes: 240
runs-on: macos-11
env:
DISABLE_ANDROID: true
DISABLE_SANDBOX: true
steps:
- { uses: actions/checkout@v3 }
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc } # v2.8.0
- { name: Start gradle, run: ./gradlew }
- { name: Run ios simulator tests, run: ./gradlew iosX64Test }
#- { name: Check compilation of tvOS targets, run: ./gradlew publishTvosArm64PublicationToMavenLocal }
- { name: Archive Test Results, if: failure(), uses: actions/upload-artifact@v3, with: { name: screenshot-test-results-macos, retention-days: 21, path: "**/build/reports", if-no-files-found: ignore } }