Skip to content

Commit

Permalink
Merge master to dotty branch (#446)
Browse files Browse the repository at this point in the history
* Update shapeless to 2.3.6 (#328)

* Update sbt to 1.5.2 (#329)

* Update kind-projector to 0.12.0

* Update sbt-mima-plugin to 0.9.1 (#333)

* Update discipline-munit to 1.0.9 (#335)

* Update alleycats-core, cats-core, ... to 2.6.1 (#334)

Co-authored-by: Georgi Krastev <[email protected]>

* Update kind-projector to 0.13.0 (#337)

* Update shapeless to 2.3.7 (#338)

* Update scala-library, scala-reflect to 2.13.6 (#339)

* Add VSCode .ignore files (#344)

* Update sbt-github-actions to 0.11.0 (#348)

* Update sbt-mima-plugin to 0.9.2 (#350)

* Update scala-library, scala-reflect to 2.12.14 (#351)

* Update sbt to 1.5.3 (#352)

* Update sbt-github-actions to 0.12.0

* Regenerate workflow with sbt-github-actions

* Update sbt-scalajs, scalajs-library, ... to 1.6.0

* Update sbt to 1.5.4 (#365)

* Update sbt-scala-native-crossproject, ... to 1.1.0 (#366)

* Update sbt-scalafmt to 2.4.3 (#367)

* Update sbt to 1.5.5 (#368)

* Update sbt-scalajs, scalajs-compiler, ... to 1.7.0 (#369)

* Update sbt-github-actions to 0.13.0 (#370)

* Update scalafmt-core to 3.0.0 (#371)

* Update scalafmt-core to 3.0.0

* Reformat with scalafmt 3.0.0

* Update sbt-mima-plugin to 1.0.0 (#372)

* Update kind-projector to 0.13.1 (#373)

* Update scalafmt-core to 3.0.1 (#378)

* Update kind-projector to 0.13.2 (#381)

* Update scalafmt-core to 3.0.2 (#380)

* Update scalafmt-core to 3.0.3 (#382)

* Update scalafmt-core to 3.0.4 (#384)

* Update scala-library, scala-reflect to 2.12.15 (#383)

* Update sbt-ci-release to 1.5.9 (#385)

* Update scalafmt-core to 3.0.5 (#386)

* Remove unnecessary instance (#388)

It was merged in cats-core.

* Update scalafmt-core to 3.0.6 (#390)

* Update sbt-mima-plugin to 1.0.1 (#391)

* Update sbt-scalajs, scalajs-compiler, ... to 1.7.1 (#392)

* Update sbt-ci-release to 1.5.10 (#396)

* Update scalafmt-core to 3.0.7 (#397)

* Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.1 (#398)

* Update scalafmt-core to 3.0.8 (#399)

* Update scala-library, scala-reflect to 2.13.7 (#400)

* Update scalafmt-core to 3.1.1 (#403)

* Update scalafmt-core to 3.1.1

* Specify runner dialect explicitly

Co-authored-by: Georgi Krastev <[email protected]>

* Update sbt-scalafmt to 2.4.4 (#404)

* Update scalafmt-core to 3.1.2 (#405)

* Update alleycats-core, cats-core, ... to 2.7.0 (#406)

* Update scalafmt-core to 3.2.0 (#407)

* Update sbt-github-actions to 0.14.2 (#409)

* Update sbt-github-actions to 0.14.2

* Set Java version to Temurin 8

Co-authored-by: Georgi Krastev <[email protected]>

* Update scalafmt-core to 3.2.1 (#410)

* Update sbt-scalafmt to 2.4.5 (#411)

* Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.2 (#412)

* Update sbt to 1.5.6 (#413)

* Update sbt-scalajs, scalajs-compiler, ... to 1.8.0 (#414)

* Update sbt to 1.5.7 (#415)

* Update sbt to 1.5.8 (#416)

* Update scalafmt-core to 3.2.2 (#417)

* Update scalafmt-core to 3.3.0 (#419)

* Update sbt-scalafmt to 2.4.6 (#418)

* Update sbt to 1.6.0 (#420)

* Update sbt to 1.6.1 (#421)

* Update scalafmt-core to 3.3.1 (#424)

* Update scala-library, scala-reflect to 2.13.8 (#426)

* Update scalafmt-core to 3.3.2 (#428)

* Update auxlib, javalib, nativelib, nscplugin, ... to 0.4.3 (#430)

* Update scalafmt-core to 3.3.3 (#431)

* Update scalafmt-core to 3.4.0 (#432)

* Update sbt to 1.6.2 (#434)

* Migrate to sbt-typelevel-ci-release (#429)

* Migrate to sbt-typelevel-ci-release

* Rescope publish settings

* Set tlVersionIntroduced

* Poke ci

* Update to latest sbt-typelevel

* Update scalafmt-core to 3.4.2 (#436)

* Use predefined Apache 2 license (#437)

* Enable snapshots on master (#438)

* Delete .sbtrc

* Publish snapshots from master

* Update sbt-typelevel-ci-release to 0.4.4 (#442)

* Update sbt-typelevel-ci-release to 0.4.4

* Regenerate workflow with sbt-github-actions

* Update sbt-typelevel-ci-release to 0.4.5 (#443)

* Update scalafmt-core to 3.4.3 (#444)

* Update shapeless to 2.3.8 (#445)

* Reformat

* Release from Dotty branch

Co-authored-by: Arman Bilge <[email protected]>

* Update Scala.js to 1.9.0

* Regenerate workflow

* Specify Munit version explicitly

* Don't override scalacOptions

* Check sbt formatting in root project

Co-authored-by: Arman Bilge <[email protected]>

* githubWorkflowGenerate

Co-authored-by: Scala Steward <[email protected]>
Co-authored-by: Scala Steward <[email protected]>
Co-authored-by: Lars Hupel <[email protected]>
Co-authored-by: Arman Bilge <[email protected]>
  • Loading branch information
5 people authored Feb 13, 2022
1 parent 52646a3 commit 2487d20
Show file tree
Hide file tree
Showing 30 changed files with 246 additions and 200 deletions.
152 changes: 128 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ name: Continuous Integration

on:
pull_request:
branches: ['*']
branches: ['**']
push:
branches: ['*']
branches: ['**']
tags: [v*]

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand All @@ -23,20 +28,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.15, 2.13.8, 3.1.0]
java: [adopt@1.8]
ci: [test]
scala: [2.12.15, 2.13.8, 3.1.1]
java: [temurin@8]
project: [rootJS, rootJVM]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 8

- name: Cache sbt
uses: actions/cache@v2
Expand All @@ -51,31 +58,63 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck

- name: Validation
run: sbt ++${{ matrix.scala }} '${{ matrix.ci }}'
- name: Check formatting
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' scalafmtCheckAll root/scalafmtSbtCheck

- name: scalaJSLink
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult

- name: Test
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@8'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dotty')
run: mkdir -p target .js/target core/.js/target core/.jvm/target .jvm/target .native/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dotty')
run: tar cf targets.tar target .js/target core/.js/target core/.jvm/target .jvm/target .native/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dotty')
uses: actions/upload-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
path: targets.tar

publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dotty')
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.1.0]
java: [adopt@1.8]
scala: [3.1.1]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 8

- name: Cache sbt
uses: actions/cache@v2
Expand All @@ -89,11 +128,76 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- uses: olafurpg/setup-gpg@v3
- name: Download target directories (2.12.15, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJS

- name: Inflate target directories (2.12.15, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.15, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJVM

- name: Inflate target directories (2.12.15, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS

- name: Inflate target directories (2.13.8, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM

- name: Inflate target directories (2.13.8, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.1.1, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-rootJS

- name: Inflate target directories (3.1.1, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.1.1, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-rootJVM

- name: Inflate target directories (3.1.1, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
run: |
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(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)
- env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: sbt ++${{ matrix.scala }} ci-release
- name: Publish
run: sbt '++${{ matrix.scala }}' tlRelease
2 changes: 1 addition & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
ghapi -X DELETE $REPO/actions/artifacts/$id
done
done
done
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ target/
*.iml
*.iws

# Ignore project files for VSCode
.bloop
.bsp
.metals
.vscode
metals.sbt

# Ignore OS X metadata
.DS_Store

Expand Down
1 change: 0 additions & 1 deletion .sbtrc

This file was deleted.

5 changes: 3 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = "3.0.0"
runner.dialect = "scala3"
version = "3.4.3"
runner.dialect = scala3
align.preset = none
maxColumn = 120
includeNoParensInSelectChains = false
Expand All @@ -10,3 +10,4 @@ rewrite.redundantBraces.stringInterpolation = true
rewrite.redundantBraces.methodBodies = true
rewrite.redundantBraces.generalExpressions = true
rewriteTokens = { "⇒": "=>", "→": "->", "←": "<-" }
fileOverride { "glob:**/*.sbt" { runner.dialect = scala212 } }
91 changes: 24 additions & 67 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ import sbt._

val scala212 = "2.12.15"
val scala213 = "2.13.8"
val scala3 = "3.1.0"
val scala3 = "3.1.1"

ThisBuild / crossScalaVersions := Seq(scala212, scala213, scala3)
ThisBuild / scalaVersion := scala3

lazy val buildSettings = Seq(
organization := "org.typelevel"
)
ThisBuild / tlBaseVersion := "3.0"
ThisBuild / organization := "org.typelevel"

val catsVersion = "2.7.0"
val munitVersion = "0.7.29"
val disciplineMunitVersion = "1.0.9"
val kindProjectorVersion = "0.13.2"
val shapeless2Version = "2.3.7"
val shapeless2Version = "2.3.8"
val shapeless3Version = "3.0.4"

lazy val commonSettings = Seq(
scalacOptions := Seq(
scalacOptions ++= Seq(
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
Expand All @@ -39,7 +38,8 @@ lazy val commonSettings = Seq(
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "alleycats-core" % catsVersion,
"org.typelevel" %%% "cats-testkit" % catsVersion % Test,
"org.typelevel" %%% "discipline-munit" % disciplineMunitVersion % Test
"org.typelevel" %%% "discipline-munit" % disciplineMunitVersion % Test,
"org.scalameta" %%% "munit" % munitVersion % Test
),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) =>
Expand All @@ -51,36 +51,19 @@ lazy val commonSettings = Seq(
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full))
)
}),
Test / parallelExecution := false,
versionScheme := Some("semver-spec"),
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "2.2.1")
Test / parallelExecution := false
)

console / initialCommands := """import shapeless._, cats._, cats.derived._"""

lazy val commonJsSettings = Seq(
Global / scalaJSStage := FastOptStage,
Test / scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)

lazy val coreSettings =
Seq.concat(buildSettings, commonSettings, crossVersionSharedSources, publishSettings)

lazy val kittens = project
.in(file("."))
.aggregate(coreJVM)
.dependsOn(coreJVM)
.settings(coreSettings: _*)
.settings(noPublishSettings)
lazy val root = tlCrossRootProject.aggregate(core)

lazy val core = crossProject(JVMPlatform)
lazy val core = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.settings(moduleName := "kittens")
.settings(coreSettings: _*)

lazy val coreJVM = core.jvm
.settings(commonSettings: _*)

addCommandAlias("root", ";project kittens")
addCommandAlias("root", ";project /")
addCommandAlias("jvm", ";project coreJVM")
addCommandAlias("js", ";project coreJS")
addCommandAlias("native", ";project coreNative")
Expand All @@ -95,43 +78,17 @@ addCommandAlias("mima", "coreJVM/mimaReportBinaryIssues")
addCommandAlias("fmt", "all scalafmtSbt scalafmtAll")
addCommandAlias("fmtCheck", "all scalafmtSbtCheck scalafmtCheckAll")

lazy val crossVersionSharedSources: Seq[Setting[_]] = Seq(Compile, Test).map { sc =>
(sc / unmanagedSourceDirectories) ++= (sc / unmanagedSourceDirectories).value.map { dir: File =>
new File(dir.getPath + "-" + scalaBinaryVersion.value.head)
}
}

lazy val publishSettings = Seq(
Test / publishArtifact := false,
pomIncludeRepository := (_ => false),
homepage := Some(url("https://github.com/typelevel/kittens")),
licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
scmInfo := Some(ScmInfo(url("https://github.com/typelevel/kittens"), "scm:git:[email protected]:typelevel/kittens.git")),
developers := List(
Developer("milessabin", "Miles Sabin", "", url("http://milessabin.com/blog")),
Developer("kailuowang", "Kai(luo) Wang", "[email protected]", url("http://kailuowang.com/")),
Developer("joroKr21", "Georgi Krastev", "[email protected]", url("https://twitter.com/Joro_Kr"))
)
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(
Developer("milessabin", "Miles Sabin", "", url("http://milessabin.com/blog")),
Developer("kailuowang", "Kai(luo) Wang", "[email protected]", url("http://kailuowang.com/")),
Developer("joroKr21", "Georgi Krastev", "[email protected]", url("https://twitter.com/Joro_Kr"))
)

lazy val noPublishSettings =
publish / skip := true

ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]")
ThisBuild / githubWorkflowArtifactUpload := false
ThisBuild / githubWorkflowBuildMatrixAdditions += "ci" -> List("test")
ThisBuild / githubWorkflowBuild := List(WorkflowStep.Sbt(List("${{ matrix.ci }}"), name = Some("Validation")))
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowPublishPreamble += WorkflowStep.Use(UseRef.Public("olafurpg", "setup-gpg", "v3"))
ThisBuild / githubWorkflowPublish := Seq(
ThisBuild / tlCiReleaseBranches := Seq("dotty")
ThisBuild / githubWorkflowBuild ~= { steps =>
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
List("scalafmtCheckAll", "root/scalafmtSbtCheck"),
name = Some("Check formatting")
) +: steps
}
Loading

0 comments on commit 2487d20

Please sign in to comment.