Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Ci pipeline #174

Merged
merged 19 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
spark: ["3.1.3","3.2.4", "3.3.4", "3.4.3", "3.5.1"]
spark: ["3.1.3","3.2.4", "3.3.4", "3.4.3", "3.5.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -21,6 +21,6 @@ jobs:
with:
jvm: zulu:8
- name: Test
run: sbt -Dspark.testVersion=${{ matrix.spark }} +test
run: sbt -Dspark.version=${{ matrix.spark }} +test
- name: Benchmark
run: sbt -Dspark.testVersion=${{ matrix.spark }} +benchmarks/Jmh/run
run: sbt -Dspark.version=${{ matrix.spark }} +benchmarks/Jmh/run
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release
on:
push:
tags: [ "*" ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v1
with:
jvm: zulu:8
- run: sbt -Dsun.net.client.defaultReadTimeout=60000 -Dsun.net.client.defaultConnectTimeout=60000 -Dspark.version=3.5.3 -v ci-release
zeotuan marked this conversation as resolved.
Show resolved Hide resolved
env:
PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}}
PGP_SECRET: ${{secrets.PGP_LONG_ID}}
SONATYPE_PASSWORD: ${{secrets.MAVEN_PASSWORD}}
SONATYPE_USERNAME: ${{secrets.MAVEN_USERNAME}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ There is a two step process for publishing.

Generate Scala 2.11 JAR files:

* Run `sbt -Dspark.testVersion=2.4.8`
* Run `sbt -Dspark.version=2.4.8`
* Run `> ; + publishSigned; sonatypeBundleRelease` to create the JAR files and release them to Maven.

Generate Scala 2.12 & Scala 2.13 JAR files:
Expand Down
57 changes: 28 additions & 29 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
inThisBuild(
List(
organization := "com.github.mrpowers",
homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
developers ++= List(
Developer("MrPowers", "Matthew Powers", "@MrPowers", url("https://github.com/MrPowers"))
)
)
)

enablePlugins(GitVersioning)
Compile / scalafmtOnCompile := true

organization := "com.github.mrpowers"
name := "spark-fast-tests"

version := "1.10.1"
name := "spark-fast-tests"

val versionRegex = """^(.*)\.(.*)\.(.*)$""".r

val scala2_13 = "2.13.14"
val scala2_12 = "2.12.20"

val sparkVersion = System.getProperty("spark.testVersion", "3.5.1")
val sparkVersion = System.getProperty("spark.version", "3.5.3")
crossScalaVersions := {
sparkVersion match {
case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13)
Expand All @@ -25,31 +33,35 @@ Test / fork := true

lazy val commonSettings = Seq(
javaOptions ++= {
Seq("-Xms512M", "-Xmx2048M", "-Duser.timezone=GMT") ++ (if (System.getProperty("java.version").startsWith("1.8.0"))
Seq("-XX:+CMSClassUnloadingEnabled")
else Seq.empty)
Seq("-Xms512M", "-Xmx2048M", "-Duser.timezone=GMT") ++ (if (System.getProperty("java.version").startsWith("1.8.0"))
Seq("-XX:+CMSClassUnloadingEnabled")
else Seq.empty)
},
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.scalatest" %% "scalatest" % "3.2.18" % "test"
),
)
)

lazy val core = (project in file("core"))
.settings(
commonSettings,
name := "core",
name := "core",
Compile / packageSrc / publishArtifact := true,
Compile / packageDoc / publishArtifact := true
)

lazy val benchmarks = (project in file("benchmarks"))
.dependsOn(core)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"org.openjdk.jmh" % "jmh-generator-annprocess" % "1.37" //required for jmh IDEA plugin. Make sure this version matches sbt-jmh version!
"org.openjdk.jmh" % "jmh-generator-annprocess" % "1.37" // required for jmh IDEA plugin. Make sure this version matches sbt-jmh version!
),
name := "benchmarks",
).enablePlugins(JmhPlugin)
name := "benchmarks",
publish / skip := true
)
.enablePlugins(JmhPlugin)

lazy val docs = (project in file("docs"))
.dependsOn(core)
Expand All @@ -58,9 +70,8 @@ lazy val docs = (project in file("docs"))
name := "docs",
laikaTheme := {
import laika.ast.Path.Root
import laika.ast.{Image, ExternalTarget}
import laika.helium.config.*
import laika.helium.Helium
import laika.helium.config.*

Helium.defaults.site
.landingPage(
Expand Down Expand Up @@ -96,26 +107,14 @@ lazy val docs = (project in file("docs"))
},
laikaIncludeAPI := true,
laikaExtensions ++= {
import laika.format.Markdown
import laika.config.SyntaxHighlighting
import laika.format.Markdown
Seq(Markdown.GitHubFlavor, SyntaxHighlighting)
},
publish / skip := true,
Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs")
)

credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials")

licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT"))
homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests"))
developers ++= List(
Developer("MrPowers", "Matthew Powers", "@MrPowers", url("https://github.com/MrPowers"))
)
scmInfo := Some(ScmInfo(url("https://github.com/mrpowers-io/spark-fast-tests"), "[email protected]:MrPowers/spark-fast-tests.git"))

updateOptions := updateOptions.value.withLatestSnapshots(false)

publishMavenStyle := true

publishTo := sonatypePublishToBundle.value

Global / useGpgPinentry := true
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")

addSbtPlugin("org.typelevel" % "laika-sbt" % "1.2.0")

Expand Down