-
Notifications
You must be signed in to change notification settings - Fork 64
257 lines (221 loc) · 6.92 KB
/
build.yaml
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: build
on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- 'trunk'
tags-ignore:
- '**'
env:
GRADLE_OPTS: "-Dkotlin.incremental=false -Dorg.gradle.logging.stacktrace=full"
jobs:
terminal-zig:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- run: zig build -p src/jvmMain/resources/jni
working-directory: mosaic-terminal
- uses: actions/upload-artifact@v4
with:
name: mosaic-terminal-jni-libraries
path: mosaic-terminal/src/jvmMain/resources/jni
if-no-files-found: error
terminal-test-binaries:
needs:
- terminal-zig
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mosaic-terminal-jni-libraries
path: mosaic-terminal/src/jvmMain/resources/jni
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/.java-version
- run: ./gradlew :mosaic-terminal:installJvmTestDistribution :mosaic-terminal:linkNativeDebugTests
- uses: actions/upload-artifact@v4
with:
name: mosaic-terminal-jvm-tests
path: mosaic-terminal/build/install/jvmTest
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: mosaic-terminal-native-tests
path: mosaic-terminal/build/bin
if-no-files-found: error
terminal-tests:
needs:
- terminal-test-binaries
strategy:
fail-fast: false
matrix:
platform:
- os: macOS-13
target: macosX64
- os: macOS-14
target: macosArm64
- os: macOS-15
target: macosArm64
- os: ubuntu-20.04
target: linuxX64
- os: ubuntu-22.04
target: linuxX64
- os: ubuntu-24.04
target: linuxX64
- os: windows-2019
target: mingwX64
- os: windows-2022
target: mingwX64
tests:
- type: native
- type: java
version: 8
- type: java
version: 11
- type: java
version: 17
- type: java
version: 21
- type: java
version: latest
runs-on: ${{ matrix.platform.os }}
steps:
### NATIVE
- uses: actions/download-artifact@v4
if: matrix.tests.type == 'native'
with:
name: mosaic-terminal-native-tests
- name: Set executable bit
if: ${{ matrix.tests.type == 'native' && !startsWith(matrix.platform.os, 'windows-') }}
run: chmod +x ${{ matrix.platform.target }}/debugTest/test.*
- run: ${{ matrix.platform.target }}/debugTest/test.*
if: matrix.tests.type == 'native'
shell: bash
### JAVA
- uses: actions/checkout@v4
if: ${{ matrix.tests.type == 'java' && matrix.tests.version == 'latest' }}
with:
sparse-checkout: .github/.java-version
sparse-checkout-cone-mode: false
- uses: actions/setup-java@v4
if: ${{ matrix.tests.type == 'java' && matrix.tests.version == 'latest' }}
with:
distribution: 'zulu'
java-version-file: .github/.java-version
- uses: actions/setup-java@v4
if: ${{ matrix.tests.type == 'java' && matrix.tests.version != 'latest' }}
with:
distribution: 'zulu'
java-version: ${{ matrix.tests.version }}
- uses: actions/download-artifact@v4
if: matrix.tests.type == 'java'
with:
name: mosaic-terminal-jvm-tests
- name: Set executable bit
if: ${{ matrix.tests.type == 'java' && !startsWith(matrix.platform.os, 'windows-') }}
run: chmod +x bin/mosaic-terminal-test
- run: bin/mosaic-terminal-test
if: matrix.tests.type == 'java'
build:
runs-on: macos-15
needs:
- terminal-zig
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mosaic-terminal-jni-libraries
path: mosaic-terminal/src/jvmMain/resources/jni
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/.java-version
- uses: gradle/actions/setup-gradle@v4
# Disabling allTests should be enough, but https://youtrack.jetbrains.com/issue/KT-74509
# mosaic-terminal runs its tests above. We only run jvmTest otherwise as code is all common.
- run: >
./gradlew
--continue
build
-x allTests
-x jvmJdk8Test
-x jvmJdk11Test
-x jvmJdk17Test
-x jvmJdk21Test
-x jvmJdk23Test
-x jvmProGuardTest
-x linuxX64Test
-x macosArm64Test
-x macosX64Test
-x mingwX64Test
jvmTest
-x :mosaic-terminal:jvmTest
docs:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/.java-version
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew dokkaHtmlMultiModule
- uses: actions/upload-artifact@v4
with:
name: html-docs
path: build/dokka/htmlMultiModule/
if-no-files-found: error
status:
if: always()
runs-on: ubuntu-latest
needs:
- docs
- terminal-tests
- build
steps:
- name: Check
run: |
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
echo "One or more jobs failed: $results"
exit 1
fi
publish:
if: ${{ github.ref == 'refs/heads/trunk' && github.repository == 'JakeWharton/mosaic' }}
runs-on: macos-15
needs:
- docs
- terminal-tests
- build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mosaic-terminal-jni-libraries
path: mosaic-terminal/src/jvmMain/resources/jni
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/.java-version
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
- uses: actions/download-artifact@v4
with:
name: html-docs
path: html-docs
- uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: site
FOLDER: html-docs
TARGET_FOLDER: docs/latest/
CLEAN: true