Skip to content

Commit 8d324d8

Browse files
gthomson31oguzhanunlu
authored andcommitted
Refactor CI (#265)
1 parent 623b38f commit 8d324d8

File tree

5 files changed

+52
-35
lines changed

5 files changed

+52
-35
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ on:
88
pull_request:
99

1010
jobs:
11-
test:
11+
ci:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
task:
16+
- name: "Run tests"
17+
command: "coverage +test"
18+
- name: "Check Scala formatting"
19+
command: "scalafmtCheckAll"
20+
- name: "Check binary compatibility"
21+
command: "+mimaReportBinaryIssues"
22+
- name: "Check assets can be published"
23+
command: "+publishLocal"
1324
steps:
14-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v5
1526
- uses: coursier/cache-action@v6
1627

1728
- name: Set up JDK 11
@@ -22,19 +33,28 @@ jobs:
2233
- name: Install sbt
2334
uses: sbt/setup-sbt@v1
2435

25-
- name: Run tests
26-
run: sbt coverage +test
36+
- name: ${{ matrix.task.name }}
37+
run: sbt ${{ matrix.task.command }}
2738

28-
- name: Check Scala formatting
29-
run: sbt scalafmtCheckAll
39+
coverage:
40+
runs-on: ubuntu-latest
41+
needs: ci
42+
steps:
43+
- uses: actions/checkout@v5
44+
- uses: coursier/cache-action@v6
45+
46+
- name: Set up JDK 11
47+
uses: actions/setup-java@v1
48+
with:
49+
java-version: 11
3050

31-
- name: Check binary compatibility
32-
run: sbt +mimaReportBinaryIssues
51+
- name: Install sbt
52+
uses: sbt/setup-sbt@v1
3353

34-
- name: Check assets can be published
35-
run: sbt +publishLocal
54+
- name: Generate coverage report
55+
run: sbt coverage +test coverageAggregate
3656

3757
- name: Submit coveralls data
38-
run: sbt coverageAggregate coveralls
58+
run: sbt coveralls
3959
env:
4060
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ on:
66
- '*'
77

88
jobs:
9-
release:
9+
docs:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v5
1313
- uses: coursier/cache-action@v6
1414

1515
- name: Install sbt
1616
uses: sbt/setup-sbt@v1
17+
1718
- name: Make site
1819
run: sbt makeSite
1920

@@ -24,24 +25,20 @@ jobs:
2425
folder: modules/core/target/site
2526
clean: false
2627

27-
- name: Deploy iglu-scala-client-data to Maven Central
28-
run: sbt "project data" ci-release
29-
env:
30-
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
31-
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
32-
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
33-
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
28+
release:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
module: [data, core, http4s]
33+
steps:
34+
- uses: actions/checkout@v5
35+
- uses: coursier/cache-action@v6
3436

35-
- name: Deploy iglu-scala-client to Maven Central
36-
run: sbt "project core" ci-release
37-
env:
38-
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
39-
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
40-
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
41-
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
37+
- name: Install sbt
38+
uses: sbt/setup-sbt@v1
4239

43-
- name: Deploy iglu-scala-client-http4s to Maven Central
44-
run: sbt "project http4s" ci-release
40+
- name: Deploy ${{ matrix.module }} to Maven Central
41+
run: sbt "project ${{ matrix.module }}" ci-release
4542
env:
4643
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
4744
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}

project/BuildSettings.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ object BuildSettings {
3232

3333
lazy val buildSettings = Seq[Setting[_]](
3434
organization := "com.snowplowanalytics",
35-
scalaVersion := "2.13.9",
36-
crossScalaVersions := Seq("3.2.0", "2.13.9", "2.12.17"),
35+
scalaVersion := "2.13.16",
36+
crossScalaVersions := Seq("3.2.0", "2.13.16", "2.12.19"),
3737
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
3838
Test / parallelExecution := false, // possible race bugs
3939
libraryDependencies ++= {
4040
if (scalaBinaryVersion.value.startsWith("2")) {
4141
List(
42-
compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full),
42+
compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.3" cross CrossVersion.full),
4343
compilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1")
4444
)
4545
} else Nil

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.8.2
1+
sbt.version=1.11.7

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.1")
22
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
33
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1")
4-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.4")
4+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.0")
55
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
66
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2")
7-
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
7+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.2")
88

99
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always

0 commit comments

Comments
 (0)