Skip to content

Commit 000cc56

Browse files
committed
Port to sbt-typelevel
1 parent eb04ec7 commit 000cc56

4 files changed

Lines changed: 229 additions & 98 deletions

File tree

.github/workflows/ci.yml

Lines changed: 206 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -9,66 +9,90 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['**']
12+
branches: ['**', '!update/**', '!pr/**']
1313
push:
14-
branches: ['**']
14+
branches: ['**', '!update/**', '!pr/**']
1515
tags: [v*]
1616

1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
20-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
21-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
19+
20+
21+
concurrency:
22+
group: ${{ github.workflow }} @ ${{ github.ref }}
23+
cancel-in-progress: true
2224

2325
jobs:
2426
build:
25-
name: Build and Test
27+
name: Test
2628
strategy:
2729
matrix:
28-
os: [ubuntu-latest]
29-
scala: [2.13.10, 3.3.1, 2.12.14]
30+
os: [ubuntu-22.04]
31+
scala: [2.13, 3, 2.12]
3032
java: [temurin@11]
33+
project: [rootJS, rootJVM]
3134
runs-on: ${{ matrix.os }}
35+
timeout-minutes: 60
3236
steps:
3337
- name: Checkout current branch (full)
34-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4
3539
with:
3640
fetch-depth: 0
3741

42+
- name: Setup sbt
43+
uses: sbt/setup-sbt@v1
44+
3845
- name: Setup Java (temurin@11)
46+
id: setup-java-temurin-11
3947
if: matrix.java == 'temurin@11'
40-
uses: actions/setup-java@v2
48+
uses: actions/setup-java@v4
4149
with:
4250
distribution: temurin
4351
java-version: 11
52+
cache: sbt
4453

45-
- name: Cache sbt
46-
uses: actions/cache@v2
47-
with:
48-
path: |
49-
~/.sbt
50-
~/.ivy2/cache
51-
~/.coursier/cache/v1
52-
~/.cache/coursier/v1
53-
~/AppData/Local/Coursier/Cache/v1
54-
~/Library/Caches/Coursier/v1
55-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
54+
- name: sbt update
55+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
56+
run: sbt +update
5657

5758
- name: Check that workflows are up to date
58-
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
59+
run: sbt githubWorkflowCheck
60+
61+
- name: Check headers and formatting
62+
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
63+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
64+
65+
- name: scalaJSLink
66+
if: matrix.project == 'rootJS'
67+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult
68+
69+
- name: Test
70+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test
71+
72+
- name: Check binary compatibility
73+
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
74+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues
75+
76+
- name: Generate API documentation
77+
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
78+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc
5979

60-
- run: sbt ++${{ matrix.scala }} ci
80+
- if: matrix.scala == '2.13.16'
81+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' docs/mdoc
6182

62-
- if: matrix.scala == '2.13.10'
63-
run: sbt ++${{ matrix.scala }} docs/mdoc
83+
- name: Make target directories
84+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
85+
run: mkdir -p modules/core/js/target modules/core/jvm/target project/target
6486

6587
- name: Compress target directories
66-
run: tar cf targets.tar target modules/core/js/target modules/core/jvm/target modules/benchmark/target project/target
88+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
89+
run: tar cf targets.tar modules/core/js/target modules/core/jvm/target project/target
6790

6891
- name: Upload target directories
69-
uses: actions/upload-artifact@v2
92+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
93+
uses: actions/upload-artifact@v4
7094
with:
71-
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
95+
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
7296
path: targets.tar
7397

7498
publish:
@@ -77,113 +101,224 @@ jobs:
77101
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
78102
strategy:
79103
matrix:
80-
os: [ubuntu-latest]
81-
scala: [2.13.10]
104+
os: [ubuntu-22.04]
82105
java: [temurin@11]
83106
runs-on: ${{ matrix.os }}
84107
steps:
85108
- name: Checkout current branch (full)
86-
uses: actions/checkout@v2
109+
uses: actions/checkout@v4
87110
with:
88111
fetch-depth: 0
89112

113+
- name: Setup sbt
114+
uses: sbt/setup-sbt@v1
115+
90116
- name: Setup Java (temurin@11)
117+
id: setup-java-temurin-11
91118
if: matrix.java == 'temurin@11'
92-
uses: actions/setup-java@v2
119+
uses: actions/setup-java@v4
93120
with:
94121
distribution: temurin
95122
java-version: 11
123+
cache: sbt
124+
125+
- name: sbt update
126+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
127+
run: sbt +update
96128

97-
- name: Cache sbt
98-
uses: actions/cache@v2
129+
- name: Download target directories (2.13, rootJS)
130+
uses: actions/download-artifact@v4
99131
with:
100-
path: |
101-
~/.sbt
102-
~/.ivy2/cache
103-
~/.coursier/cache/v1
104-
~/.cache/coursier/v1
105-
~/AppData/Local/Coursier/Cache/v1
106-
~/Library/Caches/Coursier/v1
107-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
132+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS
133+
134+
- name: Inflate target directories (2.13, rootJS)
135+
run: |
136+
tar xf targets.tar
137+
rm targets.tar
108138
109-
- name: Download target directories (2.13.10)
110-
uses: actions/download-artifact@v2
139+
- name: Download target directories (2.13, rootJVM)
140+
uses: actions/download-artifact@v4
111141
with:
112-
name: target-${{ matrix.os }}-2.13.10-${{ matrix.java }}
142+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM
113143

114-
- name: Inflate target directories (2.13.10)
144+
- name: Inflate target directories (2.13, rootJVM)
115145
run: |
116146
tar xf targets.tar
117147
rm targets.tar
118148
119-
- name: Download target directories (3.3.1)
120-
uses: actions/download-artifact@v2
149+
- name: Download target directories (3, rootJS)
150+
uses: actions/download-artifact@v4
121151
with:
122-
name: target-${{ matrix.os }}-3.3.1-${{ matrix.java }}
152+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS
123153

124-
- name: Inflate target directories (3.3.1)
154+
- name: Inflate target directories (3, rootJS)
125155
run: |
126156
tar xf targets.tar
127157
rm targets.tar
128158
129-
- name: Download target directories (2.12.14)
130-
uses: actions/download-artifact@v2
159+
- name: Download target directories (3, rootJVM)
160+
uses: actions/download-artifact@v4
131161
with:
132-
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}
162+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM
133163

134-
- name: Inflate target directories (2.12.14)
164+
- name: Inflate target directories (3, rootJVM)
165+
run: |
166+
tar xf targets.tar
167+
rm targets.tar
168+
169+
- name: Download target directories (2.12, rootJS)
170+
uses: actions/download-artifact@v4
171+
with:
172+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS
173+
174+
- name: Inflate target directories (2.12, rootJS)
175+
run: |
176+
tar xf targets.tar
177+
rm targets.tar
178+
179+
- name: Download target directories (2.12, rootJVM)
180+
uses: actions/download-artifact@v4
181+
with:
182+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM
183+
184+
- name: Inflate target directories (2.12, rootJVM)
135185
run: |
136186
tar xf targets.tar
137187
rm targets.tar
138188
139189
- name: Import signing key
140-
run: echo $PGP_SECRET | base64 -d | gpg --import
190+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
191+
env:
192+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
193+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
194+
run: echo $PGP_SECRET | base64 -d -i - | gpg --import
195+
196+
- name: Import signing key and strip passphrase
197+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
198+
env:
199+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
200+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
201+
run: |
202+
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
203+
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
204+
(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)
205+
206+
- name: Publish
207+
env:
208+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
209+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
210+
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
211+
run: sbt tlCiRelease
212+
213+
dependency-submission:
214+
name: Submit Dependencies
215+
if: github.event.repository.fork == false && github.event_name != 'pull_request'
216+
strategy:
217+
matrix:
218+
os: [ubuntu-22.04]
219+
java: [temurin@11]
220+
runs-on: ${{ matrix.os }}
221+
steps:
222+
- name: Checkout current branch (full)
223+
uses: actions/checkout@v4
224+
with:
225+
fetch-depth: 0
141226

142-
- run: sbt ++${{ matrix.scala }} release
227+
- name: Setup sbt
228+
uses: sbt/setup-sbt@v1
229+
230+
- name: Setup Java (temurin@11)
231+
id: setup-java-temurin-11
232+
if: matrix.java == 'temurin@11'
233+
uses: actions/setup-java@v4
234+
with:
235+
distribution: temurin
236+
java-version: 11
237+
cache: sbt
238+
239+
- name: sbt update
240+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
241+
run: sbt +update
242+
243+
- name: Submit Dependencies
244+
uses: scalacenter/sbt-dependency-submission@v2
245+
with:
246+
modules-ignore: rootjs_2.13 rootjs_3 rootjs_2.12 docs_2.13 docs_3 docs_2.12 rootjvm_2.13 rootjvm_3 rootjvm_2.12 rootnative_2.13 rootnative_3 rootnative_2.12 benchmark_2.13 benchmark_3 benchmark_2.12
247+
configs-ignore: test scala-tool scala-doc-tool test-internal
143248

144249
docs:
145250
name: Deploy docs
146251
needs: [publish]
147252
if: always() && needs.build.result == 'success' && (needs.publish.result == 'success' || github.ref == 'refs/heads/docs-deploy')
148253
strategy:
149254
matrix:
150-
os: [ubuntu-latest]
151-
scala: [2.13.10]
255+
os: [ubuntu-22.04]
256+
scala: [2.13.16]
152257
java: [temurin@11]
153258
runs-on: ${{ matrix.os }}
154259
steps:
155-
- name: Download target directories (2.13.10)
156-
uses: actions/download-artifact@v2
260+
- name: Download target directories (2.13, rootJS)
261+
uses: actions/download-artifact@v4
262+
with:
263+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS
264+
265+
- name: Inflate target directories (2.13, rootJS)
266+
run: |
267+
tar xf targets.tar
268+
rm targets.tar
269+
270+
- name: Download target directories (2.13, rootJVM)
271+
uses: actions/download-artifact@v4
272+
with:
273+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM
274+
275+
- name: Inflate target directories (2.13, rootJVM)
276+
run: |
277+
tar xf targets.tar
278+
rm targets.tar
279+
280+
- name: Download target directories (3, rootJS)
281+
uses: actions/download-artifact@v4
282+
with:
283+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS
284+
285+
- name: Inflate target directories (3, rootJS)
286+
run: |
287+
tar xf targets.tar
288+
rm targets.tar
289+
290+
- name: Download target directories (3, rootJVM)
291+
uses: actions/download-artifact@v4
157292
with:
158-
name: target-${{ matrix.os }}-2.13.10-${{ matrix.java }}
293+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM
159294

160-
- name: Inflate target directories (2.13.10)
295+
- name: Inflate target directories (3, rootJVM)
161296
run: |
162297
tar xf targets.tar
163298
rm targets.tar
164299
165-
- name: Download target directories (3.3.1)
166-
uses: actions/download-artifact@v2
300+
- name: Download target directories (2.12, rootJS)
301+
uses: actions/download-artifact@v4
167302
with:
168-
name: target-${{ matrix.os }}-3.3.1-${{ matrix.java }}
303+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS
169304

170-
- name: Inflate target directories (3.3.1)
305+
- name: Inflate target directories (2.12, rootJS)
171306
run: |
172307
tar xf targets.tar
173308
rm targets.tar
174309
175-
- name: Download target directories (2.12.14)
176-
uses: actions/download-artifact@v2
310+
- name: Download target directories (2.12, rootJVM)
311+
uses: actions/download-artifact@v4
177312
with:
178-
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}
313+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM
179314

180-
- name: Inflate target directories (2.12.14)
315+
- name: Inflate target directories (2.12, rootJVM)
181316
run: |
182317
tar xf targets.tar
183318
rm targets.tar
184319
185320
- name: Deploy docs
186-
uses: peaceiris/actions-gh-pages@v3
321+
uses: peaceiris/actions-gh-pages@v4
187322
with:
188323
publish_dir: ./target/website
189324
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)