Skip to content

Commit 9a91321

Browse files
committed
change ci
1 parent 8ac2e5f commit 9a91321

File tree

5 files changed

+19
-60
lines changed

5 files changed

+19
-60
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -17,84 +17,57 @@ on:
1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919

20-
21-
concurrency:
22-
group: ${{ github.workflow }} @ ${{ github.ref }}
23-
cancel-in-progress: true
24-
2520
jobs:
2621
build:
2722
name: Build and Test
2823
strategy:
2924
matrix:
3025
os: [ubuntu-latest]
31-
scala: [2.13, 2.12, 3]
26+
scala: [2.13.12, 2.12.18, 3.3.1]
3227
java: [zulu@8, zulu@11, zulu@17]
3328
runs-on: ${{ matrix.os }}
34-
timeout-minutes: 60
3529
steps:
3630
- name: Checkout current branch (full)
3731
uses: actions/checkout@v4
3832
with:
3933
fetch-depth: 0
4034

4135
- name: Setup Java (zulu@8)
42-
id: setup-java-zulu-8
4336
if: matrix.java == 'zulu@8'
4437
uses: actions/setup-java@v3
4538
with:
4639
distribution: zulu
4740
java-version: 8
4841
cache: sbt
4942

50-
- name: sbt update
51-
if: matrix.java == 'zulu@8' && steps.setup-java-zulu-8.outputs.cache-hit == 'false'
52-
run: sbt +update
53-
5443
- name: Setup Java (zulu@11)
55-
id: setup-java-zulu-11
5644
if: matrix.java == 'zulu@11'
5745
uses: actions/setup-java@v3
5846
with:
5947
distribution: zulu
6048
java-version: 11
6149
cache: sbt
6250

63-
- name: sbt update
64-
if: matrix.java == 'zulu@11' && steps.setup-java-zulu-11.outputs.cache-hit == 'false'
65-
run: sbt +update
66-
6751
- name: Setup Java (zulu@17)
68-
id: setup-java-zulu-17
6952
if: matrix.java == 'zulu@17'
7053
uses: actions/setup-java@v3
7154
with:
7255
distribution: zulu
7356
java-version: 17
7457
cache: sbt
7558

76-
- name: sbt update
77-
if: matrix.java == 'zulu@17' && steps.setup-java-zulu-17.outputs.cache-hit == 'false'
78-
run: sbt +update
79-
8059
- name: Check that workflows are up to date
81-
run: sbt githubWorkflowCheck
60+
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
8261

8362
- run: sbt '++ ${{ matrix.scala }}' coverage test coverageReport
8463

85-
- name: Make target directories
86-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/swagger-1.5' || startsWith(github.ref, 'refs/tags/v'))
87-
run: mkdir -p target project/target
88-
8964
- name: Compress target directories
90-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/swagger-1.5' || startsWith(github.ref, 'refs/tags/v'))
9165
run: tar cf targets.tar target project/target
9266

9367
- name: Upload target directories
94-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/swagger-1.5' || startsWith(github.ref, 'refs/tags/v'))
9568
uses: actions/upload-artifact@v3
9669
with:
97-
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
70+
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
9871
path: targets.tar
9972

10073
publish:
@@ -104,6 +77,7 @@ jobs:
10477
strategy:
10578
matrix:
10679
os: [ubuntu-latest]
80+
scala: [2.13.12]
10781
java: [zulu@8]
10882
runs-on: ${{ matrix.os }}
10983
steps:
@@ -113,70 +87,55 @@ jobs:
11387
fetch-depth: 0
11488

11589
- name: Setup Java (zulu@8)
116-
id: setup-java-zulu-8
11790
if: matrix.java == 'zulu@8'
11891
uses: actions/setup-java@v3
11992
with:
12093
distribution: zulu
12194
java-version: 8
12295
cache: sbt
12396

124-
- name: sbt update
125-
if: matrix.java == 'zulu@8' && steps.setup-java-zulu-8.outputs.cache-hit == 'false'
126-
run: sbt +update
127-
12897
- name: Setup Java (zulu@11)
129-
id: setup-java-zulu-11
13098
if: matrix.java == 'zulu@11'
13199
uses: actions/setup-java@v3
132100
with:
133101
distribution: zulu
134102
java-version: 11
135103
cache: sbt
136104

137-
- name: sbt update
138-
if: matrix.java == 'zulu@11' && steps.setup-java-zulu-11.outputs.cache-hit == 'false'
139-
run: sbt +update
140-
141105
- name: Setup Java (zulu@17)
142-
id: setup-java-zulu-17
143106
if: matrix.java == 'zulu@17'
144107
uses: actions/setup-java@v3
145108
with:
146109
distribution: zulu
147110
java-version: 17
148111
cache: sbt
149112

150-
- name: sbt update
151-
if: matrix.java == 'zulu@17' && steps.setup-java-zulu-17.outputs.cache-hit == 'false'
152-
run: sbt +update
153-
154-
- name: Download target directories (2.13)
113+
- name: Download target directories (2.13.12)
155114
uses: actions/download-artifact@v3
156115
with:
157-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13
116+
name: target-${{ matrix.os }}-2.13.12-${{ matrix.java }}
158117

159-
- name: Inflate target directories (2.13)
118+
- name: Inflate target directories (2.13.12)
160119
run: |
161120
tar xf targets.tar
162121
rm targets.tar
163122
164-
- name: Download target directories (2.12)
123+
- name: Download target directories (2.12.18)
165124
uses: actions/download-artifact@v3
166125
with:
167-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12
126+
name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }}
168127

169-
- name: Inflate target directories (2.12)
128+
- name: Inflate target directories (2.12.18)
170129
run: |
171130
tar xf targets.tar
172131
rm targets.tar
173132
174-
- name: Download target directories (3)
133+
- name: Download target directories (3.3.1)
175134
uses: actions/download-artifact@v3
176135
with:
177-
name: target-${{ matrix.os }}-${{ matrix.java }}-3
136+
name: target-${{ matrix.os }}-3.3.1-${{ matrix.java }}
178137

179-
- name: Inflate target directories (3)
138+
- name: Inflate target directories (3.3.1)
180139
run: |
181140
tar xf targets.tar
182141
rm targets.tar

.github/workflows/clean.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
steps:
1919
- name: Delete artifacts
20+
shell: bash {0}
2021
run: |
2122
# Customize those three lines with your repository and credentials:
2223
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
@@ -25,7 +26,7 @@ jobs:
2526
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
2627
2728
# A temporary file which receives HTTP response headers.
28-
TMPFILE=/tmp/tmp.$$
29+
TMPFILE=$(mktemp)
2930
3031
# An associative array, key: artifact name, value: number of artifacts of that name.
3132
declare -A ARTCOUNT

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import org.typelevel.sbt.gha.JavaSpec.Distribution.Zulu
2-
import org.typelevel.sbt.gha.UseRef.Public
1+
import sbtghactions.JavaSpec.Distribution.Zulu
2+
import sbtghactions.UseRef.Public
33

44
organization := "com.github.swagger-akka-http"
55

@@ -105,9 +105,9 @@ pomExtra := (
105105

106106
MetaInfLicenseCopy.settings
107107

108-
ThisBuild / tlSonatypeUseLegacyHost := true
109108
ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("coverage", "test", "coverageReport")))
110109
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec(Zulu, "8"), JavaSpec(Zulu, "11"), JavaSpec(Zulu, "17"))
110+
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
111111
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
112112
RefPredicate.Equals(Ref.Branch("main")),
113113
RefPredicate.Equals(Ref.Branch("swagger-1.5")),

project/build.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
sbt.version=1.9.7
2-

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")
22

3-
addSbtPlugin("org.typelevel" % "sbt-typelevel-sonatype-ci-release" % "0.6.0")
3+
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.19.0")
44

55
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
66

0 commit comments

Comments
 (0)