Skip to content

Commit

Permalink
Merge pull request #483 from tototoshi/github-actions-ci-reusable
Browse files Browse the repository at this point in the history
CI with GitHub Actions (using playframework/.github)
  • Loading branch information
mkurz authored Apr 14, 2022
2 parents 97a6022 + 520bebf commit dabf555
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 101 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check

on:
push:
branches: [ main ]
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/sbt.yml@v1
with:
cmd: sbt validateCode

check-binary-compatibility:
name: Binary Compatibility
uses: playframework/.github/.github/workflows/binary-check.yml@v1

check-docs:
name: Docs
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
cmd: |
cd docs
sbt evaluateSbtFiles validateDocs headerCheckAll test
tests:
name: Tests
needs: # Waiting more lightweight checks
- "check-code-style"
- "check-binary-compatibility"
- "check-docs"
uses: playframework/.github/.github/workflows/sbt-matrix.yml@v1
with: # Should be sync with Mergify conditions (.mergify.yml)
java: >-
[ "11", "8" ]
scala: >-
[ "2.12.15", "2.13.8", "3.1.1" ]
cmd: scripts/test-code.sh
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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@v1
secrets:
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
pgp_passphrase: ${{ secrets.PGP_PASSPHRASE }}
pgp_secret: ${{ secrets.PGP_SECRET }}
32 changes: 28 additions & 4 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
queue_rules:
- name: default
conditions:
# Conditions to get out of the queue (= merged)
- 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:
- status-success=Travis CI - Pull Request
- status-success=typesafe-cla-validator
- 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$
- 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" ]
83 changes: 0 additions & 83 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ def generateVersionFile =
Seq(file)
}

addCommandAlias("validateCode", ";headerCheckAll;+scalafmtCheckAll;scalafmtSbtCheck")
addCommandAlias("validateCode", "headerCheckAll; scalafmtSbtCheck; scalafmtCheckAll")
addCommandAlias("format", ";+scalafmtAll;scalafmtSbt")
2 changes: 1 addition & 1 deletion scripts/test-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Copyright (C) Lightbend Inc. <https://www.lightbend.com>

sbt "++ $SCALA_VERSION test" || exit 1
sbt "++$SCALA_VERSION test" || exit 1
sbt +publishLocal plugin/test plugin/scripted || exit 1
5 changes: 0 additions & 5 deletions scripts/validate-code.sh

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/validate-docs.sh

This file was deleted.

0 comments on commit dabf555

Please sign in to comment.