Skip to content

Commit

Permalink
Support Gradle tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ihostage committed Jun 19, 2023
1 parent 99a0f40 commit 9d22891
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ jobs:
id: coursier-cache
uses: coursier/cache-action@v6

# Inspired by https://github.com/actions/setup-java/blob/45058d7f99afcd22834b58fde7cbfb7075eb48a2/src/cache.ts#L30-L44
- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/*.versions.toml') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Custom Cache
uses: actions/cache@v3
if: ${{ inputs.cache-key != '' && inputs.cache-path != '' }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Gradle Wrapper Validation

on:
workflow_call:
inputs:
ref:
type: string
required: false
default: ''

jobs:
cmd:
name: Gradle Wrapper Validation
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0
ref: ${{ inputs.ref }}

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This repository contains a few configurations of GitHub features. For example a
* [Universal CMD task](#universal-cmd-task)
* [Publishing to Sonatype](#publishing-to-sonatype)
* [Validate Binary Compatibility](#validate-binary-compatibility)
* [Validate Gradle Wrapper](#validate-gradle-wrapper)
* [Mark Pull Request as Ready To Merge](#mark-pull-request-as-ready-to-merge)
* [Generate documentation with Antora](#generate-documentation-with-antora)

Expand Down Expand Up @@ -126,6 +127,29 @@ This workflow is used for validate binary compatibility the current version.
uses: playframework/.github/.github/workflows/binary-check.yml@v3
```

### Validate Gradle Wrapper

This workflow is used to validate the checksums of [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) JAR files present in the source tree and fails if unknown Gradle Wrapper JAR files are found.

**Path**: [`.github/workflows/gradle-wrapper-validation.yml`](.github/workflows/gradle-wrapper-validation.yml)

**Image**: [Ubuntu 20.04](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md)

**Uses actions**:
* [Gradle/Wrapper Validation Action](https://github.com/gradle/wrapper-validation-action)

**Parameters**:

| Parameter | Since | Required | Default | Description |
|------------------------|-------|--------------------|---------|---------------------------------|
| ref | 3.3.0 | :heavy_minus_sign: | '' | Branch, tag or SHA for checkout |

**How to use**:

```yaml
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.
Expand Down

0 comments on commit 9d22891

Please sign in to comment.