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

Switch to cmd.yml #757

Merged
merged 5 commits into from May 6, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/build-test.yml
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
check-code-style:
name: Code Style
uses: playframework/.github/.github/workflows/sbt.yml@v1
uses: playframework/.github/.github/workflows/cmd.yml@dynamic_matrix
with:
cmd: sbt validateCode

Expand All @@ -21,7 +21,7 @@ jobs:

check-docs:
name: Docs
uses: playframework/.github/.github/workflows/sbt.yml@v1
uses: playframework/.github/.github/workflows/cmd.yml@dynamic_matrix
with:
cmd: sbt docs/validateDocs

Expand All @@ -31,12 +31,14 @@ jobs:
- "check-code-style"
- "check-binary-compatibility"
- "check-docs"
uses: playframework/.github/.github/workflows/sbt-matrix.yml@v1
uses: playframework/.github/.github/workflows/contact@playframework.com
BillyAutrey marked this conversation as resolved.
Show resolved Hide resolved
with:
java: >-
[ "11", "8" ]
scala: >-
[ "2.12.15", "2.13.8", "3.1.3-RC2" ]
add-dimensions: >-
{
"scala": [ "2.12.15", "2.13.8", "3.1.3-RC2" ]
}
cmd: scripts/test-code.sh

finish:
Expand Down
9 changes: 8 additions & 1 deletion build.sbt
Expand Up @@ -304,4 +304,11 @@ lazy val docs = project
.settings(commonSettings)
.dependsOn(`play-jsonJVM`)

addCommandAlias("validateCode", "headerCheckAll; scalafmtSbtCheck; scalafmtCheckAll")
addCommandAlias(
"validateCode",
List(
"headerCheckAll",
"scalafmtSbtCheck",
"scalafmtCheckAll",
).mkString(";")
)
8 changes: 4 additions & 4 deletions scripts/test-code.sh
@@ -1,15 +1,15 @@
#!/usr/bin/env bash

echo SCALA_VERSION=$SCALA_VERSION
sbt -DscalaJSStage=full ++$SCALA_VERSION test publishLocal || exit 1
echo MATRIX_SCALA=$MATRIX_SCALA
sbt -DscalaJSStage=full ++$MATRIX_SCALA test publishLocal || exit 1

case "$SCALA_VERSION" in
case "$MATRIX_SCALA" in
3.*) echo "SKIPPING docs/test" ;;
# ^ because there is no play-docs for Scala 3
# and we can't use play-docs_2.13 because then:
# [error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/d/play-json/"), "docs"):
# [error] com.typesafe.play:play-functional _2.13, _3.0.0-M3
# [error] com.typesafe.play:play-json _2.13, _3.0.0-M3

*) sbt ++$SCALA_VERSION docs/test || exit 2 ;;
*) sbt ++$MATRIX_SCALA docs/test || exit 2 ;;
esac