Update gradle/gradle-build-action action to v3 #187
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
name: Run Gradle on PRs | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Run build --scan with Gradle wrapper | |
id: gradle | |
env: | |
BUILD_SCAN_TOS_ACCEPTED: true | |
run: ./gradlew build --scan | |
- name: "Add build scan URL as PR comment" | |
uses: actions/github-script@v6 | |
if: github.event_name == 'pull_request' && failure() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}' | |
}) |