@@ -9,112 +9,248 @@ name: Continuous Integration
9
9
10
10
on :
11
11
pull_request :
12
- branches : ['**']
12
+ branches : ['**', '!update/**', '!pr/**' ]
13
13
push :
14
- branches : ['**']
14
+ branches : ['**', '!update/**', '!pr/**']
15
+ tags : [v*]
15
16
16
17
env :
17
18
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
18
19
20
+
21
+ concurrency :
22
+ group : ${{ github.workflow }} @ ${{ github.ref }}
23
+ cancel-in-progress : true
24
+
19
25
jobs :
20
26
build :
21
27
name : Build and Test
22
28
strategy :
23
29
matrix :
24
30
os : [ubuntu-latest]
25
- scala : [2.12.17 , 2.13.14, 3.3. 3]
31
+ scala : [2.12, 2.13, 3]
26
32
java : [corretto@11]
33
+ project : [rootJS, rootJVM, rootNative]
34
+ include :
35
+ - scala : 3
36
+ java : corretto@11
37
+ project : rootNative
38
+ os : macos-latest
39
+ exclude :
40
+ - scala : 3
41
+ project : rootJVM
42
+ - scala : 3
43
+ project : rootNative
44
+ os : ubuntu-latest
27
45
runs-on : ${{ matrix.os }}
46
+ timeout-minutes : 60
28
47
steps :
29
- - uses : pierotofy/set-swap-space@master
30
- with :
31
- swap-size-gb : 5
32
-
33
48
- name : Checkout current branch (full)
34
49
uses : actions/checkout@v4
35
50
with :
36
51
fetch-depth : 0
37
52
38
53
- name : Setup Java (corretto@11)
54
+ id : setup-java-corretto-11
39
55
if : matrix.java == 'corretto@11'
40
56
uses : actions/setup-java@v4
41
57
with :
42
58
distribution : corretto
43
59
java-version : 11
44
60
cache : sbt
45
61
62
+ - name : sbt update
63
+ if : matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false'
64
+ run : ./sbt +update
65
+
46
66
- name : Check that workflows are up to date
47
- run : ./sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
67
+ run : ./sbt githubWorkflowCheck
68
+
69
+ - name : scalaJSLink
70
+ if : matrix.project == 'rootJS'
71
+ run : ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult
72
+
73
+ - name : nativeLink
74
+ if : matrix.project == 'rootNative'
75
+ run : ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink
76
+
77
+ - name : Test
78
+ run : ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test
79
+
80
+ - name : Check binary compatibility
81
+ if : matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest'
82
+ run : ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues
48
83
49
- - name : Build project
50
- run : ./sbt '++ ${{ matrix.scala }}' test
84
+ - name : Generate API documentation
85
+ if : matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest'
86
+ run : ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc
87
+
88
+ - name : Make target directories
89
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
90
+ run : mkdir -p core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target
51
91
52
92
- name : Compress target directories
53
- run : tar cf targets.tar target core/native/target tzdb/js/target core/js/target core/jvm/target tests/js/target demo/jvm/target tests/jvm/target demo/native/target tzdb/jvm/target tzdb/native/target tests/native/target demo/js/target project/target
93
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
94
+ run : tar cf targets.tar core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target
54
95
55
96
- name : Upload target directories
97
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
56
98
uses : actions/upload-artifact@v4
57
99
with :
58
- name : target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
100
+ name : target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix. scala }}-${{ matrix.project }}
59
101
path : targets.tar
60
102
61
103
publish :
62
104
name : Publish Artifacts
63
105
needs : [build]
64
- if : github.event_name != 'pull_request' && (github.ref == 'refs/heads/main ')
106
+ if : github.event_name != 'pull_request' && (startsWith( github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master ')
65
107
strategy :
66
108
matrix :
67
109
os : [ubuntu-latest]
68
- scala : [2.13.14]
69
110
java : [corretto@11]
70
111
runs-on : ${{ matrix.os }}
71
112
steps :
72
- - uses : pierotofy/set-swap-space@master
73
- with :
74
- swap-size-gb : 5
75
-
76
113
- name : Checkout current branch (full)
77
114
uses : actions/checkout@v4
78
115
with :
79
116
fetch-depth : 0
80
117
81
118
- name : Setup Java (corretto@11)
119
+ id : setup-java-corretto-11
82
120
if : matrix.java == 'corretto@11'
83
121
uses : actions/setup-java@v4
84
122
with :
85
123
distribution : corretto
86
124
java-version : 11
87
125
cache : sbt
88
126
89
- - name : Download target directories (2.12.17)
127
+ - name : sbt update
128
+ if : matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false'
129
+ run : ./sbt +update
130
+
131
+ - name : Download target directories (2.12, rootJS)
132
+ uses : actions/download-artifact@v4
133
+ with :
134
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS
135
+
136
+ - name : Inflate target directories (2.12, rootJS)
137
+ run : |
138
+ tar xf targets.tar
139
+ rm targets.tar
140
+
141
+ - name : Download target directories (2.12, rootJVM)
142
+ uses : actions/download-artifact@v4
143
+ with :
144
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM
145
+
146
+ - name : Inflate target directories (2.12, rootJVM)
147
+ run : |
148
+ tar xf targets.tar
149
+ rm targets.tar
150
+
151
+ - name : Download target directories (2.12, rootNative)
152
+ uses : actions/download-artifact@v4
153
+ with :
154
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative
155
+
156
+ - name : Inflate target directories (2.12, rootNative)
157
+ run : |
158
+ tar xf targets.tar
159
+ rm targets.tar
160
+
161
+ - name : Download target directories (2.13, rootJS)
90
162
uses : actions/download-artifact@v4
91
163
with :
92
- name : target-${{ matrix.os }}-2.12.17- ${{ matrix.java }}
164
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS
93
165
94
- - name : Inflate target directories (2.12.17 )
166
+ - name : Inflate target directories (2.13, rootJS )
95
167
run : |
96
168
tar xf targets.tar
97
169
rm targets.tar
98
170
99
- - name : Download target directories (2.13.14 )
171
+ - name : Download target directories (2.13, rootJVM )
100
172
uses : actions/download-artifact@v4
101
173
with :
102
- name : target-${{ matrix.os }}-2.13.14- ${{ matrix.java }}
174
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM
103
175
104
- - name : Inflate target directories (2.13.14 )
176
+ - name : Inflate target directories (2.13, rootJVM )
105
177
run : |
106
178
tar xf targets.tar
107
179
rm targets.tar
108
180
109
- - name : Download target directories (3.3.3 )
181
+ - name : Download target directories (2.13, rootNative )
110
182
uses : actions/download-artifact@v4
111
183
with :
112
- name : target-${{ matrix.os }}-3.3.3- ${{ matrix.java }}
184
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative
113
185
114
- - name : Inflate target directories (3.3.3 )
186
+ - name : Inflate target directories (2.13, rootNative )
115
187
run : |
116
188
tar xf targets.tar
117
189
rm targets.tar
118
190
119
- - name : Publish project
120
- run : ./sbt +publish
191
+ - name : Download target directories (3, rootJS)
192
+ uses : actions/download-artifact@v4
193
+ with :
194
+ name : target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS
195
+
196
+ - name : Inflate target directories (3, rootJS)
197
+ run : |
198
+ tar xf targets.tar
199
+ rm targets.tar
200
+
201
+ - name : Import signing key
202
+ if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
203
+ env :
204
+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
205
+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
206
+ run : echo $PGP_SECRET | base64 -d -i - | gpg --import
207
+
208
+ - name : Import signing key and strip passphrase
209
+ if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
210
+ env :
211
+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
212
+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
213
+ run : |
214
+ echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
215
+ echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
216
+ (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
217
+
218
+ - name : Publish
219
+ env :
220
+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
221
+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
222
+ SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
223
+ run : ./sbt tlCiRelease
224
+
225
+ dependency-submission :
226
+ name : Submit Dependencies
227
+ if : github.event_name != 'pull_request'
228
+ strategy :
229
+ matrix :
230
+ os : [ubuntu-latest]
231
+ java : [corretto@11]
232
+ runs-on : ${{ matrix.os }}
233
+ steps :
234
+ - name : Checkout current branch (full)
235
+ uses : actions/checkout@v4
236
+ with :
237
+ fetch-depth : 0
238
+
239
+ - name : Setup Java (corretto@11)
240
+ id : setup-java-corretto-11
241
+ if : matrix.java == 'corretto@11'
242
+ uses : actions/setup-java@v4
243
+ with :
244
+ distribution : corretto
245
+ java-version : 11
246
+ cache : sbt
247
+
248
+ - name : sbt update
249
+ if : matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false'
250
+ run : ./sbt +update
251
+
252
+ - name : Submit Dependencies
253
+ uses : scalacenter/sbt-dependency-submission@v2
254
+ with :
255
+ modules-ignore : rootjs_2.12 rootjs_2.13 rootjs_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 demo_2.12 demo_2.13 demo_3 tests_2.12 tests_2.13 tests_3 demo_native0.5_2.12 demo_native0.5_2.13 demo_native0.5_3 tests_native0.5_2.12 tests_native0.5_2.13 tests_native0.5_3 demo_sjs1_2.12 demo_sjs1_2.13 demo_sjs1_3
256
+ configs-ignore : test scala-tool scala-doc-tool test-internal
0 commit comments