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
[2.8.x] Switch to GitHub actions #11262
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
aa6118b
Add ci test and publish workflow
mkurz 96b45e9
Test all possible java/scala/sbt versions, but only in cron jobs
mkurz 5925a74
Add sonatype snapshots when running as cron job in GHA
mkurz d614e80
Add validateCode alias
mkurz 6498138
Replace scripts/local-pr-validation.sh with sbt validateCode in CONTR…
mkurz a555d04
New sbt-header version with improvement
mkurz c0e1873
This is done by headerCheckAll now
mkurz 942a105
No more travis, nothing to ignore
mkurz 84a05de
Wording "travis" -> "ci"
mkurz c42a2d7
Travis CI -> CI
mkurz 06fd797
Update badge (switch to GHA)
mkurz 165a03d
Remove travis conf
mkurz d7da95b
Remove scripts
mkurz e33905d
Removed mergify config (no use in 2.8.x branch)
mkurz 8f03c67
Try to work around sbt 1.3.x bug
mkurz 83cf5bb
java and scala inputs as comma separated string (thanks @ihostage)
mkurz 81d79f4
Split docs-tests from tests
mkurz bc75cb4
Switch to cmd v2
mkurz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
name: Check | ||
|
||
on: | ||
pull_request: # Check Pull Requests | ||
|
||
push: | ||
branches: | ||
- 2.8.x # Check 2.8.x branch after merge | ||
|
||
schedule: | ||
- cron: "0 3 * * *" # 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 | ||
|
||
jobs: | ||
extra-vars: | ||
name: Extra variables | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
akka_version_opts: ${{ steps.akka-snapshots.outputs.akka_opts }} | ||
akka_http_version_opts: ${{ steps.akka-snapshots.outputs.akka_http_opts }} | ||
steps: | ||
- id: akka-snapshots | ||
run: | | ||
if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then | ||
AKKA_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -oEi '2\.6\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) | ||
AKKA_HTTP_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-http-core_2.13/ | grep -oEi '10\.1\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1) | ||
echo "::set-output name=akka_opts::-Dakka.version=$AKKA_VERSION" | ||
echo "::set-output name=akka_http_opts::-Dakka.http.version=$AKKA_HTTP_VERSION" | ||
else | ||
echo "::set-output name=akka_opts::" | ||
echo "::set-output name=akka_http_opts::" | ||
fi | ||
|
||
prefetch-for-caching: | ||
name: Prefetch dependencies and JVMs for caching | ||
uses: playframework/.github/.github/workflows/cmd.yml@v2 | ||
with: | ||
cmd: | | ||
if [ "$CACHE_HIT_COURSIER" = "false" ]; then | ||
sbt +update # Runs with adoptium:8 (default) | ||
# sbt --sbt-version 1.6.2 +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 && cd .. # Fetches dependencies of the documentation project | ||
sbt -java-home `cs java-home --jvm adoptium:11` exit # Init sbt with new JVM that will be downloaded | ||
sbt -java-home `cs java-home --jvm adoptium:17` exit # Init sbt with new JVM that will be downloaded | ||
fi | ||
|
||
check-code-style: | ||
name: Code Style # scalafmt, javafmt, file headers, akka version check | ||
needs: | ||
- "extra-vars" | ||
- "prefetch-for-caching" | ||
uses: playframework/.github/.github/workflows/cmd.yml@v2 | ||
with: | ||
cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" validateCode | ||
|
||
check-binary-compatibility: | ||
name: Binary Compatibility | ||
needs: "prefetch-for-caching" | ||
uses: playframework/.github/.github/workflows/binary-check.yml@v1 | ||
|
||
check-code-style-docs: | ||
name: Code Style Docs | ||
needs: "prefetch-for-caching" | ||
uses: playframework/.github/.github/workflows/cmd.yml@v2 | ||
with: | ||
cmd: | | ||
cd documentation | ||
sbt validateCode | ||
|
||
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@v2 | ||
with: | ||
java: 11, 8 | ||
cmd: | | ||
rm -rf ~/.ivy2/local | ||
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" crossScalaVersions crossSbtVersions +publishLocal | ||
cache-path: ~/.ivy2/local/com.typesafe.play | ||
cache-key: play-published-local-jdk{0}-${{ github.sha }}-${{ github.event_name != 'schedule' || github.run_id }} | ||
|
||
tests: | ||
name: Tests | ||
needs: | ||
- "extra-vars" | ||
- "check-code-style" | ||
- "check-binary-compatibility" | ||
- "check-code-style-docs" | ||
uses: playframework/.github/.github/workflows/cmd.yml@v2 | ||
with: | ||
java: 11, 8 | ||
scala: 2.12.15, 2.13.8 | ||
add-dimensions: >- | ||
{ | ||
"sbt_test_task": [ "test", "Play-Integration-Test/It/test", "Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true" ] | ||
} | ||
exclude: >- | ||
[ | ||
{ "java": "${{ github.event_name == 'schedule' || '11' }}" }, | ||
{ "scala": "${{ github.event_name == 'schedule' || '2.12.15' }}" }, | ||
{ "sbt_test_task": "${{ github.event_name == 'schedule' || 'Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true' }}" } | ||
] | ||
cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$MATRIX_SCALA "$MATRIX_SBT_TEST_TASK" | ||
|
||
docs-tests: | ||
name: Docs Tests | ||
needs: | ||
- "extra-vars" | ||
- "check-code-style" | ||
- "check-binary-compatibility" | ||
- "check-code-style-docs" | ||
uses: playframework/.github/.github/workflows/cmd.yml@v2 | ||
with: | ||
java: 11, 8 | ||
scala: 2.12.15, 2.13.8 | ||
exclude: >- | ||
[ | ||
{ "java": "${{ github.event_name == 'schedule' || '11' }}" }, | ||
{ "scala": "${{ github.event_name == 'schedule' || '2.12.15' }}" } | ||
] | ||
cmd: cd documentation && sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$MATRIX_SCALA test | ||
|
||
scripted-tests: | ||
name: Scripted Tests | ||
needs: | ||
- "extra-vars" | ||
- "publish-local" | ||
uses: playframework/.github/.github/workflows/cmd.yml@v2 | ||
with: | ||
java: 11, 8 | ||
scala: 2.12.15, 2.13.8 | ||
add-dimensions: >- | ||
{ | ||
"sbt": [ "1.3.13", "1.6.2" ], | ||
"sbt_steps": [ "*1of3", "*2of3", "*3of3" ] | ||
} | ||
exclude: >- | ||
[ | ||
{ "java": "${{ github.event_name == 'schedule' || '11' }}" }, | ||
{ "scala": "${{ github.event_name == 'schedule' || '2.12.15' }}" }, | ||
{ "sbt": "${{ github.event_name == 'schedule' || '1.3.13' }}" } | ||
] | ||
cmd: >- | ||
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" " | ||
project Sbt-Plugin; | ||
set scriptedSbt := \"$MATRIX_SBT\"; | ||
set scriptedLaunchOpts += \"-Dscala.version=$MATRIX_SCALA\"; | ||
show scriptedSbt; | ||
show scriptedLaunchOpts; | ||
scripted play-sbt-plugin/$MATRIX_SBT_STEPS | ||
" | ||
cache-path: ~/.ivy2/local/com.typesafe.play | ||
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 | ||
- "tests" | ||
- "docs-tests" | ||
- "scripted-tests" | ||
uses: playframework/.github/.github/workflows/rtm.yml@v1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: # Snapshots | ||
- 2.8.x | ||
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 }} |
This file contains 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://stackoverflow.com/questions/58798886/github-actions-schedule-operation-on-branch
Looks like we need something more smartly for cron task for
2.8.x
branch 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I read this in the offical docs as well. We need to start the 2.8.x cron job from the default (main) branch 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a duplicate of build workflow for
2.8.x
? Inmain
branch for schedule and in2.8.x
for PR's, right? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes, this is the only solution, to have duplicated workflow files in both branches.
I was thinking about other solutions, like define a workflow in the main branch that uses the GitHub api to trigger the workflow from the 2.8.x branch with curl, but that is also not possible:
...workflows/{workflow_id}/dispatches...
, where the workflow id is just the name of the yaml file in the default branch (like https://github.com/playframework/playframework/actions/workflows/build-test.yml). Theref
body param is just meta data I think, but does not select the branch from which to run the workflow.There is even this action from the marketplace, but with the same limitations with the rest api (of course, its just a wrapper).
Also the
repository_dispatch
event can only be used to trigger workflows from the default branch.I also was looking into composite actions, but I can not see how they help here.
Anyway.
There is a discussion going on already:
https://github.community/t/scheduled-builds-of-non-default-branch/16306
However since there is no offical "bug" yet, I created one 😛 :
community/community#16107
So I think we have to use duplicate files now... Let's hope they implement this feature soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to say 🤷♂️ We will have to play by these rules for now 😞