diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..2e07fbf --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,44 @@ +name: Check + +on: + 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/cmd.yml@v2 + with: + cmd: sbt validateCode + + check-binary-compatibility: + name: Binary Compatibility + uses: playframework/.github/.github/workflows/binary-check.yml@v2 + + check-docs: + name: Docs + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + cmd: sbt doc + + tests: + name: Tests + needs: # Waiting more lightweight checks + - "check-code-style" + - "check-binary-compatibility" + - "check-docs" + uses: playframework/.github/.github/workflows/cmd.yml@v2 + with: + java: 11, 8 + scala: 2.12.15, 2.13.8, 3.1.2 + cmd: sbt ++$MATRIX_SCALA test + + finish: + name: Finish + needs: # Should be last + - "tests" + uses: playframework/.github/.github/workflows/rtm.yml@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7995107 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,13 @@ +name: Publish + +on: + push: + branches: # Snapshots + - main + tags: ["*"] # Releases + +jobs: + publish-artifacts: + name: Publish / Artifacts + uses: playframework/.github/.github/workflows/publish.yml@v2 + secrets: inherit diff --git a/.mergify.yml b/.mergify.yml index 692bde2..646d7e8 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,19 +1,28 @@ +queue_rules: + - name: default + conditions: + # Conditions to get out of the queue (= merged) + - check-success~=/ Ready To Merge$ + pull_request_rules: - name: Merge PRs that are ready conditions: - - status-success=Travis CI - Pull Request - - status-success=typesafe-cla-validator + - check-success~=/ Ready To Merge$ + - 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 5675afc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: ~> 1.0 -language: scala - -before_install: - - | - curl -Ls https://git.io/sbt -o sbt || travis_terminate 1 - chmod 0755 sbt || travis_terminate 1 - sudo mv sbt /usr/local/bin/sbt || travis_terminate 1 - - curl --version # for debug purpose - - if [ ! -f ~/.jabba/jabba.sh ]; then curl -L -v --retry 5 -o jabba-install.sh https://git.io/jabba && bash jabba-install.sh; fi - - . ~/.jabba/jabba.sh -install: jabba install $(jabba ls-remote "adopt@~1.$TRAVIS_JDK.0-0" --latest=patch) && jabba use "$_" && java -Xmx32m -version - -git: - depth: false # Avoid sbt-dynver not seeing the tag - -jobs: - include: - - stage: test - name: "Validations" - script: sbt headerCheckAll scalafmtCheckAll scalafmtSbtCheck scalastyle mimaReportBinaryIssues - env: - - TRAVIS_JDK=11 - - - name: "Run tests on AdoptOpenJDK 11" - script: sbt +test - env: - - TRAVIS_JDK=11 - - - name: "Run tests on AdoptOpenJDK 8" - script: sbt +test - env: - - TRAVIS_JDK=8 - - - stage: release - name: "Publish artifacts to Sonatype" - script: sbt ci-release - env: - - TRAVIS_JDK=8 - -stages: - - name: test - - name: release - if: tag IS present - -cache: - directories: - - "$HOME/.ivy2/cache" - - "$HOME/.jabba/jdk" - - "$HOME/.sbt" - - "$HOME/.cache/coursier" - -before_cache: - - rm -rf $HOME/.ivy2/cache/com.typesafe.play/* - - rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/* - - find $HOME/.ivy2 -name "ivydata-*.properties" -delete - - find $HOME/.sbt -name "*.lock" -delete - -branches: - only: - - main - - /^\d+\.\d+(\.\d+)?(-\S*)?$/ diff --git a/build.sbt b/build.sbt index e78359f..e960fc2 100644 --- a/build.sbt +++ b/build.sbt @@ -31,3 +31,13 @@ lazy val cachecontrol = (project in file(".")) ) } ) + +addCommandAlias( + "validateCode", + List( + "headerCheckAll", + "scalafmtSbtCheck", + "scalafmtCheckAll", + "scalastyle", + ).mkString(";") +)