diff --git a/.ci_scripts/jvmopts.sh b/.ci_scripts/jvmopts.sh deleted file mode 100644 index 192b72b1..00000000 --- a/.ci_scripts/jvmopts.sh +++ /dev/null @@ -1,14 +0,0 @@ -JVM_MAX_MEM="1G" - -JAVA_MAJOR=`java -version 2>&1 | head -n 1 | cut -d '"' -f 2 | sed -e 's/\.[0-9a-zA-Z_]*$//'` - -if [ "v$JAVA_MAJOR" = "v10.0" -o "v$JAVA_MAJOR" = "v11.0" ]; then - JVM_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=70" -else - JVM_MAX_MEM="1632M" # 1760M" - JVM_OPTS="-Xmx$JVM_MAX_MEM -XX:ReservedCodeCacheSize=192m" -fi - -#JVM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" - -export _JAVA_OPTIONS="$JVM_OPTS" diff --git a/.ci_scripts/validate.sh b/.ci_scripts/validate.sh deleted file mode 100755 index 53e44fa6..00000000 --- a/.ci_scripts/validate.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -set -e - -SCRIPT_DIR=`dirname $0 | sed -e "s|^\./|$PWD/|"` - -source "$SCRIPT_DIR/jvmopts.sh" - -sbt ++$SCALA_VERSION scalariformFormat test:scalariformFormat > /dev/null #scalafixAll -git diff --exit-code || (cat >> /dev/stdout <>/sbt-<< parameters.sbt_version >>.tgz - tar -xzvf sbt.tgz && rm -f sbt.tgz - fi - - - save_cache: - paths: - - ~/sbt - key: *sbt_cache_key - - build_n_tests: - description: Build & Run tests - steps: - - restore_cache: - keys: - - &scala_cache_key scala-{{ .Environment.CIRCLE_JOB }}-{{ checksum "version.sbt" }}-{{ checksum "build.sbt" }} - - - run: - name: Build & Run tests - command: | - export PATH=$PATH:~/sbt/bin - - ./.ci_scripts/validate.sh - - - save_cache: - paths: - - ~/.ivy2 - - ~/.coursier/cache - - ~/.sbt - key: *scala_cache_key - - collect_test_reports: - description: Collect test reports - steps: - - run: - name: Collect test report - command: | - mkdir test-reports - find . -path '*/test-reports/*' -name '*.xml' \ - -print -exec cp {} test-reports \; - when: always - -jobs: - scala211_jdk8: - docker: - - image: circleci/openjdk:8-jdk - - working_directory: ~/repo - - environment: - SCALA_VERSION: 2.11.12 - - steps: - - checkout - - setup_sbt - - build_n_tests - - collect_test_reports - - store_test_results: - path: test-reports - - scala212_jdk8: - docker: - - image: circleci/openjdk:8-jdk - - working_directory: ~/repo - - environment: - SCALA_VERSION: 2.12.15 - - steps: - - checkout - - setup_sbt - - build_n_tests - - collect_test_reports - - store_test_results: - path: test-reports - - scala213_jdk8: - docker: - - image: circleci/openjdk:8-jdk - - working_directory: ~/repo - - environment: - SCALA_VERSION: 2.13.8 - - steps: - - checkout - - setup_sbt - - build_n_tests - - collect_test_reports - - store_test_results: - path: test-reports - - scala212_jdk9: - docker: - - image: circleci/openjdk:9-jdk - - working_directory: ~/repo - - environment: - SCALA_VERSION: 2.12.15 - - steps: - - checkout - - setup_sbt - - build_n_tests - - collect_test_reports - - store_test_results: - path: test-reports - - scala213_jdk11: - docker: - - image: circleci/openjdk:11-jdk - - working_directory: ~/repo - - environment: - SCALA_VERSION: 2.13.8 - - steps: - - checkout - - setup_sbt - - build_n_tests - - collect_test_reports - - store_test_results: - path: test-reports - -workflows: - version: 2 - - main_suite: - jobs: - - scala211_jdk8 - - scala212_jdk8 - - scala213_jdk8 - - scala212_jdk9 - - scala213_jdk11 diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..478af0e2 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,46 @@ +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: + java: 11, 8 + scala: 2.11.12, 2.12.15, 2.13.8 + cmd: sbt ++$MATRIX_SCALA docs/test + + 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.11.12, 2.12.15, 2.13.8 + cmd: sbt ++$MATRIX_SCALA publishLocal test # scapegoat + + 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 00000000..14b41c9d --- /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@v2 + secrets: + username: ${{ secrets.SONATYPE_USERNAME }} + password: ${{ secrets.SONATYPE_PASSWORD }} + pgp_passphrase: ${{ secrets.PGP_PASSPHRASE }} + pgp_secret: ${{ secrets.PGP_SECRET }} diff --git a/bin/travis b/bin/travis deleted file mode 100755 index 9a4abc33..00000000 --- a/bin/travis +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -set -ev - -if [ `echo "$TRAVIS_SCALA_VERSION" | grep '^2\.12\.' | wc -l` -eq 1 ]; then - # TODO: Remove when everything is ok for 2.12 - sbt ++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues test -else - sbt ++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues test docs/test -fi diff --git a/build.sbt b/build.sbt index dcf33fd4..2d02da5d 100644 --- a/build.sbt +++ b/build.sbt @@ -303,3 +303,11 @@ lazy val docs = project Scapegoat.settings ThisBuild / playBuildRepoName := "anorm" + +addCommandAlias( + "validateCode", + List( + "scalafmtSbtCheck", + "scalafmtCheckAll", + ).mkString(";") +)