Skip to content
playframeworkPublic

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

3 watching

Forks

Latest commit

 

History

203 Commits

Folders and files

Repository files navigation

Playframework GitHub integration

Twitter Follow Discord GitHub Discussions StackOverflow YouTube Twitch Status OpenCollective

Repository size Scala Steward badge Mergify Status

This repository contains a few configurations of GitHub features. For example a Reusing workflows or Starter workflows as GitHub Actions features.

GitHub Actions Reusing Workflows

Universal CMD task

This workflow is used for running any CMD task on matrix of Java versions and other dimensions.

Every matrix dimension will be access by environment variable like MATRIX_$(uppercase(dimension_name)) (for example MATRIX_JAVA).

Path: .github/workflows/cmd.yml

Image: Ubuntu 20.04

Uses actions:

Parameters:

Parameter Since Required Default Description
ref 2.0.0 ➖ '' Branch, tag or SHA for checkout
cmd 2.0.0 ❗ - Running command
java 2.0.0 ➖ 17 AdoptJDK version (space/comma delimited list)
java-index 3.3.1 ➖ '' URL to JVM index source file
scala 2.0.0 ➖ '' Scala version (space/comma delimited list)
add-dimensions 2.0.0 ➖ '' Other matrix dimensions (json object)
include 2.0.0 ➖ [] Matrix include's (json object array)
exclude 2.0.0 ➖ [] Matrix exclude's (json object array)
fail-fast 4.2.0 ➖ true Cancel other matrix jobs when one fails
cache-key 2.0.0 ➖ '' Key of custom cache
cache-path 2.0.0 ➖ '' Path of custom cache
sbt-cache-namespace 4.3.0 ➖ '' Job-specific namespace for sbt 2 cache snapshots; empty uses sbt/setup-sbt defaults
env 2.0.0 ➖ '' Custom ENV vars
run-scheduled-in-forks 3.1.1 ➖ false Run by schedule in fork
gradle-build-root 3.3.0 ➖ '' Directory for Gradle builds
ignore-job-coursier-cache 3.4.0 ➖ true ignoreJob parameter for Coursier Cache
ignore-matrix-coursier-cache 3.4.0 ➖ true ignoreMatrix parameter for Coursier Cache
extra-coursier-cache-key 3.4.0 ➖ '' extraKey parameter for Coursier Cache

How to use:

uses: playframework/.github/.github/workflows/cmd.yml@v3
with:
  java: 17, 21
  java-index: https://url/of/your/index.json
  scala: 2.12.19, 2.13.13, 3.3.1
  add-dimensions: >-
    {
      "color": [ "red", "green"]
    }
  cmd: sbt "-Dcustom_var=$CUSTOM_VAR" "-Dcolor=$MATRIX_COLOR" "-Djava=$MATRIX_JAVA" ++$MATRIX_SCALA test
  env: |
    CUSTOM_VAR=value

For the custom cache-key/cache-path cache, cmd receives CACHE_HIT_CUSTOM=true only on an exact key match. Commands can check this value before regenerating restored files; a miss, partial match or skipped cache step must still run the producer.

Set sbt-cache-namespace to a distinct name for each job, such as unit-tests, to persist sbt 2's action cache (AC) and content-addressable storage (CAS) in ~/.cache/sbt. An empty namespace keeps the disk cache managed by sbt/setup-sbt.

Snapshots are partitioned by runner OS/architecture, namespace, installed JDK and complete matrix. Keys also include a hash of the sbt build definition and the workflow run ID/attempt, so each successful job saves a fresh snapshot. Restores try the same build definition first, then fall back within the same partition; sbt decides which cached task results can be reused.

Scheduled runs still restore and save build caches. The workflow sets SBT_CACHE_TEST_RESULT=false for scheduled runs so sbt 2 executes tests again; other events use true.

Publishing to Sonatype

This workflow is used for publishing snapshots artifacts to Sonatype Snapshots repository or release artifacts to Maven Central.

⚠️ For using this workflow project must uses the CI Release plugin.

Path: .github/workflows/publish.yml

Image: Ubuntu 20.04

Uses actions:

Parameters:

Parameter Since Required Default Description
ref 2.0.0 ➖ '' Branch, tag or SHA for checkout
java 1.0.0 ➖ 17 AdoptJDK version
java-index 3.3.1 ➖ '' URL to JVM index source file
cmd 3.3.0 ➖ sbt ci-release Running command
gradle-build-root 3.3.0 ➖ '' Directory for Gradle builds
ignore-job-coursier-cache 3.4.0 ➖ true ignoreJob parameter for Coursier Cache
extra-coursier-cache-key 3.4.0 ➖ '' extraKey parameter for Coursier Cache

How to use:

uses: playframework/.github/.github/workflows/publish.yml@v3

Validate Binary Compatibility

This workflow is used for validate binary compatibility the current version.

⚠️ For using this workflow project must uses the SBT MiMa plugin.

Path: .github/workflows/binary-check.yml

Image: Ubuntu 20.04

Uses actions:

Parameters:

Parameter Since Required Default Description
ref 2.0.0 ➖ '' Branch, tag or SHA for checkout
java 1.0.0 ➖ 17 AdoptJDK version
java-index 3.3.1 ➖ '' URL to JVM index source file
sbt-cache-namespace 4.3.0 ➖ '' Job-specific namespace for sbt 2 cache snapshots; empty uses sbt/setup-sbt defaults
run-scheduled-in-forks 3.1.1 ➖ false Run by schedule in fork
ignore-job-coursier-cache 3.4.0 ➖ true ignoreJob parameter for Coursier Cache
extra-coursier-cache-key 3.4.0 ➖ '' extraKey parameter for Coursier Cache

How to use:

uses: playframework/.github/.github/workflows/binary-check.yml@v3

The optional sbt-cache-namespace input uses the snapshot policy described for the Universal CMD task, with the selected Java version as its matrix dimension. Use a distinct namespace such as binary-check.

Validate Gradle Wrapper

This workflow is used to validate the checksums of Gradle Wrapper JAR files present in the source tree and fails if unknown Gradle Wrapper JAR files are found.

Path: .github/workflows/gradle-wrapper-validation.yml

Image: Ubuntu 20.04

Uses actions:

Parameters:

Parameter Since Required Default Description
ref 3.3.0 ➖ '' Branch, tag or SHA for checkout

How to use:

uses: playframework/.github/.github/workflows/gradle-wrapper-validation.yml@v3

Mark Pull Request as Ready To Merge

This workflow is used for mark pull request as ready to merge and should be last in the workflows chain.

⚠️ For using this workflow don't forget to configure the needs (GA docs) attribute to make this workflow run last.

Path: .github/workflows/rtm.yml

Image: Ubuntu 20.04

No Parameters

How to use:

needs: # Should be latest
  - "check-code-style"
  - "..."
  - "tests"
uses: playframework/.github/.github/workflows/rtm.yml@v3

Generate documentation with Antora

This workflow is used for generate and optionally publish documentation with Antora.

Path: .github/workflows/antora.yml

Image: Ubuntu 20.04

Uses actions:

Parameters:

Parameter Since Required Default Description
path 3.1.0 ➖ ./ Path with docs
playbook 3.1.0 ➖ local-antora-playbook.yml Playbook file name
publish 3.1.0 ➖ false Publish to GH Pages
run-scheduled-in-forks 3.1.1 ➖ false Run by schedule in fork

How to use:

uses: playframework/.github/.github/workflows/antora.yml@v3

GitHub Actions Starter workflows

TODO

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages