forked from swiftlang/swift-java
-
Notifications
You must be signed in to change notification settings - Fork 0
266 lines (252 loc) · 10.8 KB
/
pull_request.yml
File metadata and controls
266 lines (252 loc) · 10.8 KB
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
258
259
260
261
262
263
264
265
266
name: pull_request
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
soundness:
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
# Not API stable package (yet)
api_breakage_check_enabled: false
# FIXME: Something is off with the format task and it gets "stuck", need to investigate
format_check_enabled: false
license_header_check_project_name: Swift.org
# Since we need JAVA_HOME to be set up for building the project and depending on a different workflow won't
# give us that, we disable the checking and make a separate job that performs docs validation
docs_check_enabled: false
# This replicates 'docs-check' from https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/soundness.yml
# because we need to set up environment so we can build the SwiftJava project (including Java runtime/dependencies).
soundness-docs:
name: Documentation check
runs-on: ubuntu-latest
container:
image: 'swift:6.2-noble'
strategy:
fail-fast: true
matrix:
swift_version: ['6.2']
os_version: ['jammy']
jdk_vendor: ['corretto']
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Swift Build
run: swift build --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418
- name: Run documentation check
run: ./.github/scripts/validate_docs.sh
test-java:
name: Test (Java) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
swift_version: ['6.2', 'nightly']
os_version: ['jammy']
jdk_vendor: ['corretto']
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Gradle :SwiftKitCore:build
run: ./gradlew :SwiftKitCore:build -x test
- name: Gradle :SwiftKitCore:check
run: ./gradlew :SwiftKitCore:check --info
- name: Gradle :SwiftKitFFM:build
run: ./gradlew :SwiftKitFFM:build -x test
- name: Gradle :SwiftKitFFM:check
run: ./gradlew :SwiftKitFFM:check --info
test-java-macos:
name: Test (Java) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: [self-hosted, macos, tahoe, ARM64]
strategy:
fail-fast: true
matrix:
swift_version: ['6.2']
os_version: ['macos']
jdk_vendor: ['corretto']
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Gradle :SwiftKitCore:build
run: ./gradlew :SwiftKitCore:build -x test
- name: Gradle :SwiftKitCore:check
run: ./gradlew :SwiftKitCore:check --debug
- name: Gradle :SwiftKitFFM:build
run: ./gradlew :SwiftKitFFM:build -x test
- name: Gradle :SwiftKitFFM:check
run: ./gradlew :SwiftKitFFM:check --debug
benchmark-java:
name: Benchmark (JMH) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
swift_version: ['6.2']
os_version: ['jammy']
jdk_vendor: ['corretto']
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Gradle compile JMH benchmarks
run: ./gradlew compileJmh --info
benchmark-swift:
name: Benchmark (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
swift_version: ['6.2']
os_version: ['jammy']
jdk_vendor: ['corretto']
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Install jemalloc
run: apt-get update && apt-get install -y libjemalloc-dev
- name: Swift Benchmarks
run: swift package --package-path Benchmarks/ --disable-experimental-prebuilts benchmark # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418
test-swift:
name: Test (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift_version: ['6.1.3', '6.2', 'nightly']
os_version: ['jammy']
jdk_vendor: ['corretto']
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Swift Build
run: swift build --build-tests --disable-sandbox --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418
- name: Swift Test (XCTest)
run: swift test --disable-experimental-swift-testing --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418
- name: Swift Test (swift-testing)
run: swift test --disable-xctest --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418
test-swift-macos:
name: Test (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: [self-hosted, macos, tahoe, ARM64]
strategy:
fail-fast: false
matrix:
swift_version: ['6.2.3']
os_version: ['macos']
jdk_vendor: ['corretto']
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Install Swiftly
run: ./.github/scripts/install_swiftly.sh
env:
SWIFT_VERSION: "${{ matrix.swift_version }}"
- name: Swift Build
run: "swift build --build-tests --disable-sandbox"
- name: Swift Test (swift-testing)
run: swift test --disable-xctest
- name: Swift Test (XCTest)
run: swift test --disable-experimental-swift-testing
build-swift-android:
name: Sample SwiftJavaExtractJNISampleApp (Android) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}} android:${{matrix.sdk_triple}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift_version: ['nightly-main']
os_version: ['jammy']
jdk_vendor: ['corretto']
sdk_triple: ['x86_64-unknown-linux-android28']
ndk_version: ['r27d']
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Install Swift SDK for Android and build
run: |
apt-get -q update && apt-get -yq install curl
cd Samples/SwiftJavaExtractJNISampleApp
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
bash -s -- --android --build-command="swift build" --android-sdk-triple="${{ matrix.sdk_triple }}" --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }}
verify-samples:
name: Sample ${{ matrix.sample_app }} (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift_version: ['6.1.3', '6.2', 'nightly']
os_version: ['jammy']
jdk_vendor: ['corretto']
sample_app: [ # TODO: use a reusable-workflow to generate those names
'JavaDependencySampleApp',
'JavaKitSampleApp',
'JavaProbablyPrime',
'JavaSieve',
'SwiftAndJavaJarSampleLib',
'SwiftJavaExtractFFMSampleApp',
'SwiftJavaExtractJNISampleApp',
]
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: "Verify sample: ${{ matrix.sample_app }}"
run: .github/scripts/validate_sample.sh Samples/${{ matrix.sample_app }}
verify-samples-macos:
name: Sample ${{ matrix.sample_app }} (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: [self-hosted, macos, tahoe, ARM64]
strategy:
fail-fast: false
matrix:
swift_version: ['6.2'] # no nightly testing on macOS
os_version: ['macos']
jdk_vendor: ['corretto']
sample_app: [ # TODO: use a reusable-workflow to generate those names
'JavaDependencySampleApp',
'JavaKitSampleApp',
'JavaProbablyPrime',
'JavaSieve',
'SwiftAndJavaJarSampleLib',
'SwiftJavaExtractFFMSampleApp',
'SwiftJavaExtractJNISampleApp',
]
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Install Swiftly # we specifically install Swiftly in macOS jobs because we want a simpler way to find the right dylib paths for libraries
run: ./.github/scripts/install_swiftly.sh
env:
SWIFT_VERSION: "${{ matrix.swift_version }}"
- name: "Verify sample ${{ matrix.sample_app }}"
run: .github/scripts/validate_sample.sh Samples/${{ matrix.sample_app }}