Merge pull request #14318 from scala-steward/update/patches #8019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check | |
| on: | |
| pull_request: # Check Pull Requests | |
| push: | |
| branches: | |
| - main # Check branch after merge | |
| schedule: | |
| - cron: "0 4 * * *" # Nightly build (@daily) | |
| concurrency: | |
| # Only run once for latest commit per ref and cancel other (previous) runs. | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # for checkout | |
| jobs: | |
| extra-vars: | |
| name: Extra variables | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| pekko_version_opts: ${{ steps.pekko-snapshots.outputs.pekko_opts }} | |
| pekko_http_version_opts: ${{ steps.pekko-snapshots.outputs.pekko_http_opts }} | |
| steps: | |
| - id: pekko-snapshots | |
| run: | | |
| if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then | |
| PEKKO_VERSION=$(curl -s https://repository.apache.org/content/repositories/snapshots/org/apache/pekko/pekko-actor_2.13/ | grep -oEi '2\.0\.[0-9]+\-[RCM0-9]+\+[0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) | |
| PEKKO_HTTP_VERSION=$(curl -s https://repository.apache.org/content/repositories/snapshots/org/apache/pekko/pekko-http-core_2.13/ | grep -oEi '2\.0\.[0-9]+\-[RCM0-9]+\+[0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) | |
| echo "pekko_opts=-Dpekko.version=$PEKKO_VERSION" >> $GITHUB_OUTPUT | |
| echo "pekko_http_opts=-Dpekko.http.version=$PEKKO_HTTP_VERSION" >> $GITHUB_OUTPUT | |
| else | |
| echo "pekko_opts=" >> $GITHUB_OUTPUT | |
| echo "pekko_http_opts=" >> $GITHUB_OUTPUT | |
| fi | |
| prefetch-for-caching: | |
| name: Prefetch dependencies and JVMs for caching | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| cmd: | | |
| if [ "$CACHE_HIT_COURSIER" = "false" ]; then | |
| sbt +update # Fetches dependencies for published 2.13/3.3 artifacts | |
| sbt "-Dscala.version=3.9.x" update # Fetches dependencies for the Scala 3 LTS test lane | |
| sbt "-Dscala.version=3.next" update # Fetches dependencies for the Scala 3 next test lane | |
| # sbt --sbt-version 1.12.15 +update # If we run scripted tests with multiple sbt versions, we could init that sbt installs here | |
| sbt +mimaPreviousClassfiles # Fetches previous artifacts | |
| cd documentation | |
| sbt +update # Fetches documentation dependencies for published artifacts | |
| sbt "-Dscala.version=3.9.x" update # Fetches documentation dependencies for the Scala 3 LTS lane | |
| sbt "-Dscala.version=3.next" update # Fetches documentation dependencies for the Scala 3 next lane | |
| cd .. | |
| sbt -java-home `cs java-home --jvm adoptium:17` exit # Init sbt with new JVM that will be downloaded | |
| sbt -java-home `cs java-home --jvm adoptium:21` exit # Init sbt with new JVM that will be downloaded | |
| sbt -java-home `cs java-home --jvm adoptium:25` exit # Init sbt with new JVM that will be downloaded | |
| fi | |
| # Run Gradle Wrapper Validation to verify the wrapper's checksum | |
| gradle-validation: | |
| name: Gradle Wrapper | |
| uses: playframework/.github/.github/workflows/gradle-wrapper-validation.yml@unblock-repo_scala_sbt_org | |
| check-code-style: | |
| name: Code Style # scalafmt, javafmt, file headers, pekko version check | |
| needs: | |
| - "extra-vars" | |
| - "prefetch-for-caching" | |
| - "gradle-validation" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| cmd: | | |
| sbt "${{needs.extra-vars.outputs.pekko_version_opts}}" "${{needs.extra-vars.outputs.pekko_http_version_opts}}" "savePlayVersion; validateCode" | |
| cd dev-mode/gradle-plugin | |
| ./gradlew clean spotlessCheck --no-daemon | |
| gradle-build-root: dev-mode/gradle-plugin | |
| check-binary-compatibility: | |
| name: Binary Compatibility | |
| needs: "prefetch-for-caching" | |
| uses: playframework/.github/.github/workflows/binary-check.yml@unblock-repo_scala_sbt_org | |
| check-code-style-docs: | |
| name: Code Style Docs | |
| needs: "prefetch-for-caching" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| cmd: | | |
| cd documentation | |
| sbt validateCode | |
| check-api-docs-package-tree: | |
| name: Check Public API Docs Packages | |
| needs: | |
| - "extra-vars" | |
| - "check-code-style" | |
| - "check-binary-compatibility" | |
| - "check-code-style-docs" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| cmd: >- | |
| sbt "${{needs.extra-vars.outputs.pekko_version_opts}}" "${{needs.extra-vars.outputs.pekko_http_version_opts}}" +Play-Docs/checkApiDocsPackageTree | |
| publish-local: | |
| name: Publish Local | |
| needs: | |
| - "extra-vars" | |
| - "check-code-style" | |
| - "check-binary-compatibility" | |
| - "check-code-style-docs" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| java: 25, 21, 17 | |
| exclude: >- | |
| [ | |
| { "java": "${{ github.event_name == 'schedule' || '21' }}" } | |
| ] | |
| cmd: | | |
| rm -rf ~/.ivy2/local ~/.m2/repository/org/playframework | |
| sbt "${{needs.extra-vars.outputs.pekko_version_opts}}" "${{needs.extra-vars.outputs.pekko_http_version_opts}}" "crossScalaVersions; crossSbtVersions; +publishLocal; +publishM2" | |
| cache-path: | | |
| ~/.ivy2/local/org.playframework | |
| ~/.m2/repository/org/playframework | |
| cache-key: play-published-local-jdk{0}-${{ github.sha }}-${{ github.event_name != 'schedule' || github.run_id }} | |
| tests: | |
| name: Tests | |
| if: "!contains(github.event.pull_request.labels.*.name, 'ci:skip-tests')" | |
| needs: | |
| - "extra-vars" | |
| - "check-code-style" | |
| - "check-binary-compatibility" | |
| - "check-code-style-docs" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| java: 25, 21, 17 | |
| # Symbolic lanes resolve to exact versions in project/Versions.scala. | |
| scala: 2.13.x, 3.3.x, 3.9.x, 3.next | |
| add-dimensions: >- | |
| { | |
| "sbt_test_task": [ "test", "Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 $JMH_PARAMS -foe=true" ] | |
| } | |
| exclude: >- | |
| [ | |
| { "java": "${{ github.event_name == 'schedule' || '21' }}" }, | |
| { "sbt_test_task": "${{ github.event_name == 'schedule' || 'Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 $JMH_PARAMS -foe=true' }}" } | |
| ] | |
| cmd: >- | |
| sbt "${{needs.extra-vars.outputs.pekko_version_opts}}" "${{needs.extra-vars.outputs.pekko_http_version_opts}}" "-Dscala.version=$MATRIX_SCALA" "show scalaVersion;" "$(eval "echo $MATRIX_SBT_TEST_TASK")" | |
| docs-tests: | |
| name: Docs Tests | |
| if: "!contains(github.event.pull_request.labels.*.name, 'ci:skip-docs-tests')" | |
| needs: | |
| - "extra-vars" | |
| - "check-code-style" | |
| - "check-binary-compatibility" | |
| - "check-code-style-docs" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| java: 25, 21, 17 | |
| # Symbolic lanes resolve to exact versions in project/Versions.scala. | |
| scala: 2.13.x, 3.3.x, 3.9.x, 3.next | |
| exclude: >- | |
| [ | |
| { "java": "${{ github.event_name == 'schedule' || '21' }}" } | |
| ] | |
| cmd: >- | |
| cd documentation && sbt "${{needs.extra-vars.outputs.pekko_version_opts}}" "${{needs.extra-vars.outputs.pekko_http_version_opts}}" "-Dscala.version=$MATRIX_SCALA" "show scalaVersion;" test | |
| scripted-tests: | |
| name: Scripted Tests | |
| if: "!contains(github.event.pull_request.labels.*.name, 'ci:skip-scripted-tests')" | |
| needs: | |
| - "extra-vars" | |
| - "publish-local" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| java: 25, 21, 17 | |
| # Scripted tests consume locally published 2.13/3.3 artifacts with each supported compiler line. | |
| scala: 2.13.x, 3.3.x, 3.9.x, 3.next | |
| add-dimensions: >- | |
| { | |
| "sbt": [ "1.12.15", "2.1.0-bin-20260928-0a70458-NIGHTLY" ], | |
| "sbt_steps": [ "*1of3", "*2of3", "*3of3" ] | |
| } | |
| exclude: >- | |
| [ | |
| { "java": "${{ github.event_name == 'schedule' || '21' }}" } | |
| ] | |
| # Match each scripted sbt version with the Scala version used to | |
| # build its plugin variant. | |
| cmd: >- | |
| case "$MATRIX_SBT" in | |
| 1.*) export SBT_PLUGIN_SCALA=2.12.x ;; | |
| *) export SBT_PLUGIN_SCALA=3.9.x ;; | |
| esac; | |
| sbt "${{needs.extra-vars.outputs.pekko_version_opts}}" "${{needs.extra-vars.outputs.pekko_http_version_opts}}" " | |
| project Sbt-Plugin; | |
| ++ $SBT_PLUGIN_SCALA; | |
| set scriptedSbt := \"$MATRIX_SBT\"; | |
| set scriptedLaunchOpts += \"-Dscala.version=\" + ScalaVersions.resolveScalaVersion(\"$MATRIX_SCALA\"); | |
| set scriptedLaunchOpts += \"-Dscala.crossversions=\" + ScalaVersions.testedScalaVersions.mkString(\" \"); | |
| show scriptedSbt; | |
| show scriptedLaunchOpts; | |
| disableIncompatibleScriptedTests; | |
| scripted play-sbt-plugin/$MATRIX_SBT_STEPS | |
| " | |
| cache-path: | | |
| ~/.ivy2/local/org.playframework | |
| ~/.m2/repository/org/playframework | |
| cache-key: play-published-local-jdk{0}-${{ github.sha }}-${{ github.event_name != 'schedule' || github.run_id }} | |
| gradle-plugin-tests: | |
| name: Gradle Plugin Tests | |
| needs: | |
| - "extra-vars" | |
| - "publish-local" | |
| uses: playframework/.github/.github/workflows/cmd.yml@unblock-repo_scala_sbt_org | |
| with: | |
| java: 25, 21, 17 | |
| # Gradle only consumes the locally published artifacts by binary suffix, so one lane per suffix is enough. | |
| scala: 2.13.x, 3.3.x | |
| exclude: >- | |
| [ | |
| { "java": "${{ github.event_name == 'schedule' || '21' }}" } | |
| ] | |
| cmd: | | |
| sbt savePlayVersion | |
| cd dev-mode/gradle-plugin | |
| ./gradlew clean check -x spotlessCheck --no-daemon -Pscala.version="$MATRIX_SCALA" | |
| gradle-build-root: dev-mode/gradle-plugin | |
| cache-path: | | |
| ~/.ivy2/local/org.playframework | |
| ~/.m2/repository/org/playframework | |
| cache-key: play-published-local-jdk{0}-${{ github.sha }}-${{ github.event_name != 'schedule' || github.run_id }} | |
| finish: | |
| name: Finish | |
| if: github.event_name == 'pull_request' | |
| needs: # Should be last | |
| - "check-api-docs-package-tree" | |
| - "tests" | |
| - "docs-tests" | |
| - "scripted-tests" | |
| - "gradle-plugin-tests" | |
| uses: playframework/.github/.github/workflows/rtm.yml@unblock-repo_scala_sbt_org |