Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a reusable workflows #705

Merged
merged 3 commits into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 19 additions & 83 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Requests
name: Check

on:
pull_request:
Expand All @@ -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
29 changes: 6 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
36 changes: 18 additions & 18 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down