mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-05-04 21:58:35 +02:00
Allow job-summary only on failure
Instead of a binary true/false option, it is now possible to only add a Job Summary when the build failed. This applies both to the overall Job Summary added to the workflow run, and to the new PR comment feature.
This commit is contained in:
parent
34a07dced0
commit
333078158e
5 changed files with 112 additions and 20 deletions
23
.github/workflows/demo-job-summary.yml
vendored
23
.github/workflows/demo-job-summary.yml
vendored
|
@ -8,7 +8,7 @@ env:
|
|||
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
|
||||
|
||||
jobs:
|
||||
run-gradle-builds:
|
||||
many-gradle-builds:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
|
@ -42,6 +42,27 @@ jobs:
|
|||
continue-on-error: true
|
||||
run: ./gradlew not-a-real-task
|
||||
|
||||
successful-builds-with-no-summary:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
- name: Build distribution
|
||||
shell: bash
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
add-job-summary: on-failure
|
||||
- name: Build kotlin-dsl project
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew assemble
|
||||
- name: Build kotlin-dsl project without Build Scan®
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew assemble check --no-scan
|
||||
|
||||
pre-existing-gradle-home:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
33
.github/workflows/demo-pr-build-scan-comment.yml
vendored
33
.github/workflows/demo-pr-build-scan-comment.yml
vendored
|
@ -3,7 +3,7 @@ on:
|
|||
pull_request:
|
||||
types: [assigned, review_requested]
|
||||
jobs:
|
||||
gradle:
|
||||
successful-build-with-always-comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout project sources
|
||||
|
@ -11,8 +11,37 @@ jobs:
|
|||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
add-pr-comment: true
|
||||
add-job-summary-as-pr-comment: always
|
||||
- name: Run build with Gradle wrapper
|
||||
id: gradle
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build --scan
|
||||
|
||||
successful-build-with-comment-on-failure:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout project sources
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
add-job-summary-as-pr-comment: on-failure
|
||||
- name: Run build with Gradle wrapper
|
||||
id: gradle
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build --scan
|
||||
|
||||
failing-build-with-comment-on-failure:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout project sources
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
add-job-summary-as-pr-comment: on-failure
|
||||
- name: Run build with Gradle wrapper
|
||||
id: gradle
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew no-a-real-task --scan
|
||||
continue-on-error: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue