diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0a76c0b0e..22105e325 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,4 +1,4 @@ -name: Pull Requests +name: Check on: pull_request: @@ -10,95 +10,31 @@ concurrency: jobs: check-code-style: - name: Check / Code Style - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves - fetch-depth: 0 - - - name: Set up JDK 11 - uses: olafurpg/setup-scala@v13 - with: - java-version: adopt@1.11 - - - name: Cache Coursier cache - uses: coursier/cache-action@v6.2 - - - name: Code validations - run: sbt validateCode + name: Code Style + uses: playframework/.github/.github/workflows/sbt.yml@main + with: + cmd: sbt validateCode check-binary-compatibility: - name: Check / Binary Compatibility - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves - fetch-depth: 0 - - - name: Set up JDK 11 - uses: olafurpg/setup-scala@v13 - with: - java-version: adopt@1.11 - - - name: Cache Coursier cache - uses: coursier/cache-action@v6.2 - - - name: MiMa validations - run: sbt mimaReportBinaryIssues + name: Binary Compatibility + uses: playframework/.github/.github/workflows/binary-check.yml@main check-docs: - name: Check / Docs - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves - fetch-depth: 0 - - - name: Set up JDK 11 - uses: olafurpg/setup-scala@v13 - with: - java-version: adopt@1.11 - - - name: Cache Coursier cache - uses: coursier/cache-action@v6.2 - - - name: Docs validations - run: sbt docs/validateDocs + name: Docs + uses: playframework/.github/.github/workflows/sbt.yml@main + with: + cmd: sbt docs/validateDocs tests: - runs-on: ubuntu-20.04 + name: Tests needs: # Waiting more lightweight checks - "check-code-style" - "check-binary-compatibility" - "check-docs" - strategy: - matrix: - jdk: [ 11, 8 ] - scala: [ 2.12.15, 2.13.8, 3.1.2-RC3 ] # Should be sync with Mergify conditions (.mergify.yml) - name: Check / Tests (Scala ${{ matrix.scala }} & JDK ${{ matrix.jdk }}) - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves - fetch-depth: 0 - - - name: Set up JDK ${{ matrix.jdk }} - uses: olafurpg/setup-scala@v13 - with: - java-version: adopt@1.${{ matrix.jdk }} - - - name: Cache Coursier cache - uses: coursier/cache-action@v6.2 - - - name: Tests - run: scripts/test-code.sh - env: - SCALA_VERSION: ${{ matrix.scala }} + uses: playframework/.github/.github/workflows/sbt-matrix.yml@main + with: # Should be sync with Mergify conditions (.mergify.yml) + java: >- + [ "11", "8" ] + scala: >- + [ "2.12.15", "2.13.8", "3.1.2-RC3" ] + cmd: scripts/test-code.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 51bd56111..8c8ec6124 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,26 +10,9 @@ on: jobs: publish-artifacts: name: Publish / Artifacts - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves - fetch-depth: 0 - - - name: Set up JDK 8 - uses: olafurpg/setup-scala@v13 - with: - java-version: adopt@1.8 - - - name: Cache Coursier cache - uses: coursier/cache-action@v6.2 - - - name: Publish artifcats - run: sbt ci-release - env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + uses: playframework/.github/.github/workflows/publish.yml@main + 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 c18c869b0..6d797105e 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,28 +2,28 @@ queue_rules: - name: default conditions: # Conditions to get out of the queue (= merged) - - check-success=Check / Code Style - - check-success=Check / Binary Compatibility - - check-success=Check / Docs - - check-success~=^Check / Tests \(Scala 2\.12\.(\d+) & JDK 11\)$ - - check-success~=^Check / Tests \(Scala 2\.13\.(\d+) & JDK 11\)$ - - check-success~=^Check / Tests \(Scala 3\.(\d+)\.(\d+) & JDK 11\)$ - - check-success~=^Check / Tests \(Scala 2\.12\.(\d+) & JDK 8\)$ - - check-success~=^Check / Tests \(Scala 2\.13\.(\d+) & JDK 8\)$ - - check-success~=^Check / Tests \(Scala 3\.(\d+)\.(\d+) & JDK 8\)$ + - 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: - - check-success=Check / Code Style - - check-success=Check / Binary Compatibility - - check-success=Check / Docs - - check-success~=^Check / Tests \(Scala 2\.12\.(\d+) & JDK 11\)$ - - check-success~=^Check / Tests \(Scala 2\.13\.(\d+) & JDK 11\)$ - - check-success~=^Check / Tests \(Scala 3\.(\d+)\.(\d+) & JDK 11\)$ - - check-success~=^Check / Tests \(Scala 2\.12\.(\d+) & JDK 8\)$ - - check-success~=^Check / Tests \(Scala 2\.13\.(\d+) & JDK 8\)$ - - check-success~=^Check / Tests \(Scala 3\.(\d+)\.(\d+) & JDK 8\)$ + - 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$ - status-success=typesafe-cla-validator - "#approved-reviews-by>=1" - "#review-requested=0"