Skip to content

Commit 5163128

Browse files
committed
Enable sbt-typelevel-ci-release
1 parent 25fa4c1 commit 5163128

File tree

4 files changed

+361
-41
lines changed

4 files changed

+361
-41
lines changed

.github/workflows/ci.yml

Lines changed: 291 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,317 @@
1-
# Much copied from sbt-github-actions, modified to support running e2e tests
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
28
name: Continuous Integration
39

410
on:
511
pull_request:
6-
branches: ['*']
12+
branches: ['**', '!update/**', '!pr/**']
713
push:
8-
branches: ['master']
14+
branches: ['**', '!update/**', '!pr/**']
15+
tags: [v*]
16+
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
21+
concurrency:
22+
group: ${{ github.workflow }} @ ${{ github.ref }}
23+
cancel-in-progress: true
924

1025
jobs:
1126
build:
12-
name: Build and Test
13-
if: "!contains(github.event.head_commit.message, 'ci skip')"
14-
continue-on-error: ${{ matrix.experimental }}
27+
name: Test
1528
strategy:
16-
fail-fast: false
1729
matrix:
18-
os: [ubuntu-latest]
19-
scala: [2.13.6, 2.12.14, 2.11.12]
20-
21-
experimental: [false]
22-
include:
23-
- os: ubuntu-latest
24-
scala: 2.13.6
25-
26-
experimental: true
30+
os: [ubuntu-22.04]
31+
scala: [2.11.12, 2.12.14, 2.13.6]
32+
java: [temurin@8, temurin@11, temurin@17, temurin@21]
2733
runs-on: ${{ matrix.os }}
34+
timeout-minutes: 60
2835
steps:
2936
- name: Checkout current branch (full)
30-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3138
with:
3239
fetch-depth: 0
3340

34-
- name: Setup Java and Scala
35-
uses: olafurpg/setup-scala@v14
41+
- name: Setup sbt
42+
uses: sbt/setup-sbt@v1
43+
44+
- name: Setup Java (temurin@8)
45+
id: setup-java-temurin-8
46+
if: matrix.java == 'temurin@8'
47+
uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: 8
51+
cache: sbt
52+
53+
- name: sbt update
54+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
55+
run: sbt +update
56+
57+
- name: Setup Java (temurin@11)
58+
id: setup-java-temurin-11
59+
if: matrix.java == 'temurin@11'
60+
uses: actions/setup-java@v4
61+
with:
62+
distribution: temurin
63+
java-version: 11
64+
cache: sbt
65+
66+
- name: sbt update
67+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
68+
run: sbt +update
69+
70+
- name: Setup Java (temurin@17)
71+
id: setup-java-temurin-17
72+
if: matrix.java == 'temurin@17'
73+
uses: actions/setup-java@v4
3674
with:
37-
java-version: ${{ matrix.java }}
75+
distribution: temurin
76+
java-version: 17
77+
cache: sbt
78+
79+
- name: sbt update
80+
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
81+
run: sbt +update
3882

39-
- name: Cache ivy2
40-
uses: actions/cache@v1
83+
- name: Setup Java (temurin@21)
84+
id: setup-java-temurin-21
85+
if: matrix.java == 'temurin@21'
86+
uses: actions/setup-java@v4
4187
with:
42-
path: ~/.ivy2/cache
43-
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
88+
distribution: temurin
89+
java-version: 21
90+
cache: sbt
91+
92+
- name: sbt update
93+
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
94+
run: sbt +update
95+
96+
- name: Check that workflows are up to date
97+
run: sbt githubWorkflowCheck
98+
99+
- name: Test
100+
run: sbt '++ ${{ matrix.scala }}' test
101+
102+
- name: Generate API documentation
103+
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
104+
run: sbt '++ ${{ matrix.scala }}' doc
105+
106+
- name: Make target directories
107+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
108+
run: mkdir -p target project/target
109+
110+
- name: Compress target directories
111+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
112+
run: tar cf targets.tar target project/target
113+
114+
- name: Upload target directories
115+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
119+
path: targets.tar
120+
121+
publish:
122+
name: Publish Artifacts
123+
needs: [build]
124+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
125+
strategy:
126+
matrix:
127+
os: [ubuntu-22.04]
128+
java: [temurin@8]
129+
runs-on: ${{ matrix.os }}
130+
steps:
131+
- name: Checkout current branch (full)
132+
uses: actions/checkout@v4
133+
with:
134+
fetch-depth: 0
135+
136+
- name: Setup sbt
137+
uses: sbt/setup-sbt@v1
138+
139+
- name: Setup Java (temurin@8)
140+
id: setup-java-temurin-8
141+
if: matrix.java == 'temurin@8'
142+
uses: actions/setup-java@v4
143+
with:
144+
distribution: temurin
145+
java-version: 8
146+
cache: sbt
147+
148+
- name: sbt update
149+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
150+
run: sbt +update
151+
152+
- name: Setup Java (temurin@11)
153+
id: setup-java-temurin-11
154+
if: matrix.java == 'temurin@11'
155+
uses: actions/setup-java@v4
156+
with:
157+
distribution: temurin
158+
java-version: 11
159+
cache: sbt
160+
161+
- name: sbt update
162+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
163+
run: sbt +update
44164

45-
- name: Cache coursier (linux)
46-
uses: actions/cache@v1
165+
- name: Setup Java (temurin@17)
166+
id: setup-java-temurin-17
167+
if: matrix.java == 'temurin@17'
168+
uses: actions/setup-java@v4
47169
with:
48-
path: ~/.cache/coursier/v1
49-
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
170+
distribution: temurin
171+
java-version: 17
172+
cache: sbt
173+
174+
- name: sbt update
175+
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
176+
run: sbt +update
177+
178+
- name: Setup Java (temurin@21)
179+
id: setup-java-temurin-21
180+
if: matrix.java == 'temurin@21'
181+
uses: actions/setup-java@v4
182+
with:
183+
distribution: temurin
184+
java-version: 21
185+
cache: sbt
186+
187+
- name: sbt update
188+
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
189+
run: sbt +update
190+
191+
- name: Download target directories (2.11.12)
192+
uses: actions/download-artifact@v4
193+
with:
194+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.11.12
195+
196+
- name: Inflate target directories (2.11.12)
197+
run: |
198+
tar xf targets.tar
199+
rm targets.tar
200+
201+
- name: Download target directories (2.12.14)
202+
uses: actions/download-artifact@v4
203+
with:
204+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.14
205+
206+
- name: Inflate target directories (2.12.14)
207+
run: |
208+
tar xf targets.tar
209+
rm targets.tar
210+
211+
- name: Download target directories (2.13.6)
212+
uses: actions/download-artifact@v4
213+
with:
214+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.6
215+
216+
- name: Inflate target directories (2.13.6)
217+
run: |
218+
tar xf targets.tar
219+
rm targets.tar
220+
221+
- name: Import signing key
222+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
223+
env:
224+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
225+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
226+
run: echo $PGP_SECRET | base64 -d -i - | gpg --import
227+
228+
- name: Import signing key and strip passphrase
229+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
230+
env:
231+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
232+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
233+
run: |
234+
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
235+
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
236+
(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)
237+
238+
- name: Publish
239+
env:
240+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
241+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
242+
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
243+
run: sbt tlCiRelease
244+
245+
dependency-submission:
246+
name: Submit Dependencies
247+
if: github.event.repository.fork == false && github.event_name != 'pull_request'
248+
strategy:
249+
matrix:
250+
os: [ubuntu-22.04]
251+
java: [temurin@8]
252+
runs-on: ${{ matrix.os }}
253+
steps:
254+
- name: Checkout current branch (full)
255+
uses: actions/checkout@v4
256+
with:
257+
fetch-depth: 0
258+
259+
- name: Setup sbt
260+
uses: sbt/setup-sbt@v1
261+
262+
- name: Setup Java (temurin@8)
263+
id: setup-java-temurin-8
264+
if: matrix.java == 'temurin@8'
265+
uses: actions/setup-java@v4
266+
with:
267+
distribution: temurin
268+
java-version: 8
269+
cache: sbt
270+
271+
- name: sbt update
272+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
273+
run: sbt +update
274+
275+
- name: Setup Java (temurin@11)
276+
id: setup-java-temurin-11
277+
if: matrix.java == 'temurin@11'
278+
uses: actions/setup-java@v4
279+
with:
280+
distribution: temurin
281+
java-version: 11
282+
cache: sbt
283+
284+
- name: sbt update
285+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
286+
run: sbt +update
287+
288+
- name: Setup Java (temurin@17)
289+
id: setup-java-temurin-17
290+
if: matrix.java == 'temurin@17'
291+
uses: actions/setup-java@v4
292+
with:
293+
distribution: temurin
294+
java-version: 17
295+
cache: sbt
296+
297+
- name: sbt update
298+
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
299+
run: sbt +update
50300

51-
- name: Cache sbt
52-
uses: actions/cache@v1
301+
- name: Setup Java (temurin@21)
302+
id: setup-java-temurin-21
303+
if: matrix.java == 'temurin@21'
304+
uses: actions/setup-java@v4
53305
with:
54-
path: ~/.sbt
55-
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
306+
distribution: temurin
307+
java-version: 21
308+
cache: sbt
56309

57-
- name: Run tests
58-
run: sbt clean coverage test coverageReport
59-
- name: Coverage Aggregate
60-
run: sbt coverageAggregate
310+
- name: sbt update
311+
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
312+
run: sbt +update
61313

62-
- name: Codecov
63-
uses: codecov/codecov-action@v5
314+
- name: Submit Dependencies
315+
uses: scalacenter/sbt-dependency-submission@v2
64316
with:
65-
fail_ci_if_error: false
317+
configs-ignore: test scala-tool scala-doc-tool test-internal

0 commit comments

Comments
 (0)