This is an automated email from the ASF dual-hosted git repository. fanningpj pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/incubator-pekko-grpc.git
commit 334e9c3192a238327b67198701af781226f3bdc2 Author: Matthew de Detrich <[email protected]> AuthorDate: Thu Nov 10 10:17:49 2022 +0100 Add github workflow to check scala code is formatted --- .github/workflows/build-test.yml | 4 ++-- .github/workflows/format.yml | 24 ++++++++++++++++++++++++ project/Common.scala | 4 +--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e232e9a6..4edf7437 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -38,10 +38,10 @@ jobs: env: FOSSA_API_KEY: "${{secrets.FOSSA_API_KEY}}" - - name: Code style check and binary-compatibility check + - name: Binary-compatibility check run: |- cp .jvmopts-ghactions .jvmopts - sbt scalafmtCheckAll scalafmtSbtCheck headerCheckAll grpcVersionSyncCheck googleProtobufVersionSyncCheck +mimaReportBinaryIssues + sbt headerCheckAll grpcVersionSyncCheck googleProtobufVersionSyncCheck +mimaReportBinaryIssues compile-benchmarks: name: Compile Benchmarks diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..9ce98e55 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,24 @@ +name: Scalafmt + +permissions: read-all + +on: + pull_request: + branches: ['**'] + +jobs: + build: + name: Code is formatted + runs-on: ubuntu-latest + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Check project is formatted + uses: jrouly/scalafmt-native-action@v2 + with: + version: '3.6.1' + arguments: '--list --mode diff-ref=origin/main' diff --git a/project/Common.scala b/project/Common.scala index 0d45d1c1..cc8b6925 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -5,7 +5,6 @@ import sbt._ import sbt.plugins.JvmPlugin import akka.grpc.Dependencies.Versions.{ scala212, scala213 } import com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys.projectInfoVersion -import org.scalafmt.sbt.ScalafmtPlugin.autoImport.scalafmtOnCompile import com.typesafe.tools.mima.plugin.MimaKeys._ import sbtprotoc.ProtocPlugin.autoImport.PB import xerial.sbt.Sonatype @@ -75,6 +74,5 @@ object Common extends AutoPlugin { apiURL := Some(url(s"https://doc.akka.io/api/akka-grpc/${projectInfoVersion.value}/akka/grpc/index.html")), (Test / testOptions) += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"), crossScalaVersions := Seq(scala212, scala213), - mimaReportSignatureProblems := true, - scalafmtOnCompile := true) + mimaReportSignatureProblems := true) } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
