From 905f51ad34ead27d5cd4652188d5e2d64b6cdf3a Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Mon, 23 Dec 2024 07:35:17 -0800 Subject: [PATCH 1/2] Validate gradle wrapper inline Updates to v4 of the gradle wrapper validation action --- .github/workflows/documentation.yml | 1 + .github/workflows/gradle-wrapper-validation.yml | 14 -------------- .github/workflows/gradle.yml | 11 +++++++++++ .github/workflows/lint-format.yml | 11 +++++++++++ .github/workflows/sentinel-build.yml | 9 +++++++++ .github/workflows/tools.yml | 1 + 6 files changed, 33 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/gradle-wrapper-validation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 0ace70927e4..e9202045d1d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -20,6 +20,7 @@ jobs: with: fetch-depth: 0 persist-credentials: false + - uses: gradle/actions/wrapper-validation@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index 3f00c644bd9..00000000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Validate Gradle Wrapper" -on: [pull_request, push] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: gradle/actions/wrapper-validation@v3 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5ee9430ac00..3d8d58921d7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,6 +7,13 @@ concurrency: cancel-in-progress: true jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gradle/actions/wrapper-validation@v4 + build-docker: strategy: fail-fast: false @@ -26,6 +33,7 @@ jobs: build-options: "-Ponlylinuxx86-64" name: "Build - ${{ matrix.artifact-name }}" runs-on: ubuntu-22.04 + needs: [validation] steps: - name: Free Disk Space uses: jlumbroso/free-disk-space@main @@ -109,10 +117,12 @@ jobs: outputs: "ntcoreffi/build/outputs" name: "Build - ${{ matrix.artifact-name }}" runs-on: ${{ matrix.os }} + needs: [validation] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: gradle/actions/wrapper-validation@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' @@ -181,6 +191,7 @@ jobs: build-documentation: name: "Build - Documentation" runs-on: ubuntu-22.04 + needs: [validation] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 10f61ae6c87..3a98feb7ffc 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -11,9 +11,17 @@ concurrency: cancel-in-progress: true jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gradle/actions/wrapper-validation@v4 + wpiformat: name: "wpiformat" runs-on: ubuntu-22.04 + needs: [validation] steps: - uses: actions/checkout@v4 with: @@ -51,6 +59,7 @@ jobs: tidy: name: "clang-tidy" runs-on: ubuntu-22.04 + needs: [validation] container: wpilib/ubuntu-base:22.04 steps: - uses: actions/checkout@v4 @@ -81,6 +90,7 @@ jobs: javaformat: name: "Java format" runs-on: ubuntu-22.04 + needs: [validation] container: wpilib/ubuntu-base:22.04 steps: - uses: actions/checkout@v4 @@ -114,6 +124,7 @@ jobs: documentation: name: "Documentation" runs-on: ubuntu-22.04 + needs: [validation] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/sentinel-build.yml b/.github/workflows/sentinel-build.yml index 18adcf7675c..7ab1e7dbee7 100644 --- a/.github/workflows/sentinel-build.yml +++ b/.github/workflows/sentinel-build.yml @@ -10,6 +10,13 @@ concurrency: cancel-in-progress: true jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gradle/actions/wrapper-validation@v4 + build-docker: if: (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main') || github.event_name != 'schedule' strategy: @@ -30,6 +37,7 @@ jobs: build-options: "-Ponlylinuxx86-64" name: "Build - ${{ matrix.artifact-name }}" runs-on: ubuntu-22.04 + needs: [validation] steps: - name: Free Disk Space uses: jlumbroso/free-disk-space@main @@ -101,6 +109,7 @@ jobs: outputs: "ntcoreffi/build/outputs" name: "Build - ${{ matrix.artifact-name }}" runs-on: ${{ matrix.os }} + needs: [validation] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 899ac4239b4..453c6b32318 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -29,6 +29,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: gradle/actions/wrapper-validation@v4 - name: Build WPILib with Gradle uses: addnab/docker-run-action@v3 with: From c7996b02312327eb8a0ec412e46359fab5e92888 Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Mon, 23 Dec 2024 19:47:41 -0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Ryan Blue --- .github/workflows/gradle.yml | 1 - .github/workflows/lint-format.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3d8d58921d7..5e8b49b54d9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -122,7 +122,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: gradle/actions/wrapper-validation@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 3a98feb7ffc..d787d9c729e 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -21,7 +21,6 @@ jobs: wpiformat: name: "wpiformat" runs-on: ubuntu-22.04 - needs: [validation] steps: - uses: actions/checkout@v4 with: