diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..8e2935bd --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,44 @@ +name: Check + +on: + push: + branches: [ main ] + pull_request: + +concurrency: + # Only run once for latest commit per ref and cancel other (previous) runs. + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-code-style: + name: Code Style + uses: playframework/.github/.github/workflows/sbt.yml@v1 + with: + cmd: sbt validateCode + + check-binary-compatibility: + name: Binary Compatibility + uses: playframework/.github/.github/workflows/binary-check.yml@v1 + + check-docs: + name: Docs + uses: playframework/.github/.github/workflows/sbt.yml@v1 + with: + cmd: | + cd docs + sbt evaluateSbtFiles validateDocs headerCheckAll test + + tests: + name: Tests + needs: # Waiting more lightweight checks + - "check-code-style" + - "check-binary-compatibility" + - "check-docs" + uses: playframework/.github/.github/workflows/sbt-matrix.yml@v1 + with: # Should be sync with Mergify conditions (.mergify.yml) + java: >- + [ "11", "8" ] + scala: >- + [ "2.12.15", "2.13.8", "3.1.1" ] + cmd: scripts/test-code.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..f0004ffe --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +name: Publish + +on: + push: + branches: # Snapshots + - main + tags: ["*"] # Releases + +jobs: + publish-artifacts: + name: Publish / Artifacts + uses: playframework/.github/.github/workflows/publish.yml@v1 + secrets: + username: ${{ secrets.SONATYPE_USERNAME }} + password: ${{ secrets.SONATYPE_PASSWORD }} + pgp_passphrase: ${{ secrets.PGP_PASSPHRASE }} + pgp_secret: ${{ secrets.PGP_SECRET }} diff --git a/.mergify.yml b/.mergify.yml index 93083e96..e49d28b9 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,20 +1,44 @@ +queue_rules: + - name: default + conditions: + # Conditions to get out of the queue (= merged) + - check-success~=^Code Style / JDK (\d+)$ + - check-success~=^Binary Compatibility / JDK (\d+)$ + - check-success~=^Docs / JDK (\d+)$ + - check-success~=^Tests / Scala 2\.12\.(\d+) & JDK 11$ + - check-success~=^Tests / Scala 2\.13\.(\d+) & JDK 11$ + - check-success~=^Tests / Scala 3\.(\d+)\.(\d+)(-RC\d+)? & JDK 11$ + - check-success~=^Tests / Scala 2\.12\.(\d+) & JDK 8$ + - check-success~=^Tests / Scala 2\.13\.(\d+) & JDK 8$ + - check-success~=^Tests / Scala 3\.(\d+)\.(\d+)(-RC\d+)? & JDK 8$ pull_request_rules: - name: Merge PRs that are ready conditions: - - status-success=Travis CI - Pull Request - - status-success=typesafe-cla-validator + - check-success~=^Code Style / JDK (\d+)$ + - check-success~=^Binary Compatibility / JDK (\d+)$ + - check-success~=^Docs / JDK (\d+)$ + - check-success~=^Tests / Scala 2\.12\.(\d+) & JDK 11$ + - check-success~=^Tests / Scala 2\.13\.(\d+) & JDK 11$ + - check-success~=^Tests / Scala 3\.(\d+)\.(\d+)(-RC\d+)? & JDK 11$ + - check-success~=^Tests / Scala 2\.12\.(\d+) & JDK 8$ + - check-success~=^Tests / Scala 2\.13\.(\d+) & JDK 8$ + - check-success~=^Tests / Scala 3\.(\d+)\.(\d+)(-RC\d+)? & JDK 8$ + - check-success=typesafe-cla-validator - "#approved-reviews-by>=1" - "#review-requested=0" - "#changes-requested-reviews-by=0" - label!=status:block-merge - label=status:merge-when-green actions: - merge: + queue: method: merge - + name: default + - name: Delete the PR branch after merge conditions: - merged actions: delete_head_branch: {} + label: + remove: [ "status:merge-when-green" ] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 62764aa7..00000000 --- a/.travis.yml +++ /dev/null @@ -1,83 +0,0 @@ -version: ~> 1.0 -import: scala/scala-dev:travis/default.yml - -language: scala - -git: - depth: false # Avoid sbt-dynver not seeing the tag - -env: - matrix: - - ADOPTOPENJDK=11 - -jobs: - include: - - stage: test - script: scripts/validate-code.sh - name: "Code validations (headerCheck, scalafmt, mima)" - - - name: "Run tests with Scala 2.12 and AdoptOpenJDK 11" - script: scripts/test-code.sh - env: - - SCALA_VERSION=2.12.15 - - ADOPTOPENJDK=11 - - - name: "Run tests with Scala 2.13 and AdoptOpenJDK 11" - script: scripts/test-code.sh - env: - - SCALA_VERSION=2.13.8 - - ADOPTOPENJDK=11 - - - name: "Run tests with Scala 3 and AdoptOpenJDK 11" - script: scripts/test-code.sh - env: - - SCALA_VERSION=3.1.1 - - ADOPTOPENJDK=11 - - - name: "Run tests with Scala 2.12 and AdoptOpenJDK 8" - script: scripts/test-code.sh - env: - - SCALA_VERSION=2.12.15 - - ADOPTOPENJDK=8 - - - name: "Run tests with Scala 2.13 and AdoptOpenJDK 8" - script: scripts/test-code.sh - env: - - SCALA_VERSION=2.13.8 - - ADOPTOPENJDK=8 - - - name: "Run tests with Scala 3 and AdoptOpenJDK 8" - script: scripts/test-code.sh - env: - - SCALA_VERSION=3.1.1 - - ADOPTOPENJDK=8 - - - stage: docs - script: scripts/validate-docs.sh - name: "Validate documentation" - - - stage: release - name: "Release artifacts to Sonatype" - script: sbt ci-release - env: - - ADOPTOPENJDK=8 - -stages: - - name: test - - name: docs - - name: release - if: tag IS present - -notifications: - webhooks: - urls: https://webhooks.gitter.im/e/d2c8a242a2615f659595 - on_success: always - on_failure: always - slack: - secure: lrBEBp00Fwr3T72GXK+eOaQVNy34QT+OBcJanr/WCVoD3kgt+L5hkEZ3iS9B7pDd26vMBcUGBb5kM8Z5QGo48gvbLUFgRtaTU00EBoTXbUPDIqlaMkuxdF+TN7GgS7yZKnKIInj54e7o1QaJ4R/I/Atw81kUJr0PNzMU0hfg6VU= - -# safelist -branches: - only: - - main - - /^\d+\.\d+(\.\d+)?(-\S*)?$/ diff --git a/build.sbt b/build.sbt index 022f8949..7949cc2a 100644 --- a/build.sbt +++ b/build.sbt @@ -170,5 +170,5 @@ def generateVersionFile = Seq(file) } -addCommandAlias("validateCode", ";headerCheckAll;+scalafmtCheckAll;scalafmtSbtCheck") +addCommandAlias("validateCode", "headerCheckAll; scalafmtSbtCheck; scalafmtCheckAll") addCommandAlias("format", ";+scalafmtAll;scalafmtSbt") diff --git a/scripts/test-code.sh b/scripts/test-code.sh index 3529644a..018b2a19 100755 --- a/scripts/test-code.sh +++ b/scripts/test-code.sh @@ -2,5 +2,5 @@ # Copyright (C) Lightbend Inc. -sbt "++ $SCALA_VERSION test" || exit 1 +sbt "++$SCALA_VERSION test" || exit 1 sbt +publishLocal plugin/test plugin/scripted || exit 1 diff --git a/scripts/validate-code.sh b/scripts/validate-code.sh deleted file mode 100755 index b995b446..00000000 --- a/scripts/validate-code.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -sbt "validateCode;+mimaReportBinaryIssues" || exit 1 diff --git a/scripts/validate-docs.sh b/scripts/validate-docs.sh deleted file mode 100755 index 58a4de11..00000000 --- a/scripts/validate-docs.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) Lightbend Inc. - -pushd docs || exit 1 - sbt evaluateSbtFiles validateDocs headerCheck Test/headerCheck test || exit 1 -popd