From e4f7e30846cc8a5167b4f4c8e540ecdca51cfff6 Mon Sep 17 00:00:00 2001 From: Mixmix00 <68516760+Mixmix00@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:53:12 -0800 Subject: [PATCH 1/4] Add spotless to actually run on PR and push to main --- .github/workflows/spotlessApply.yml | 69 +++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/spotlessApply.yml diff --git a/.github/workflows/spotlessApply.yml b/.github/workflows/spotlessApply.yml new file mode 100644 index 000000000..222303cf2 --- /dev/null +++ b/.github/workflows/spotlessApply.yml @@ -0,0 +1,69 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "main" ] + pull_request: + + workflow_dispatch: + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Build with Gradle Wrapper + run: ./gradlew spotlessApply + + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + # with: + # gradle-version: '8.5' + # + # - name: Build with Gradle 8.5 + # run: gradle spotless apply + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 From 021320d532fae0d3a0f3cd5a91beec3c0da9d24a Mon Sep 17 00:00:00 2001 From: Mixmix00 <68516760+Mixmix00@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:57:55 -0800 Subject: [PATCH 2/4] Update spotless.yml --- .github/workflows/spotless.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index db6d12576..cebb50ba0 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -21,4 +21,7 @@ jobs: with: distribution: 'zulu' java-version: 17 - - run: ./gradlew spotlessCheck \ No newline at end of file + - name: Apply spotless linter + run: ./gradlew spotlessApply + - name: Run spotless linter check + - run: ./gradlew spotlessCheck From f32566bccea69830b976742c688b45fc311170e7 Mon Sep 17 00:00:00 2001 From: Mixmix00 <68516760+Mixmix00@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:58:47 -0800 Subject: [PATCH 3/4] Delete .github/workflows/spotlessApply.yml --- .github/workflows/spotlessApply.yml | 69 ----------------------------- 1 file changed, 69 deletions(-) delete mode 100644 .github/workflows/spotlessApply.yml diff --git a/.github/workflows/spotlessApply.yml b/.github/workflows/spotlessApply.yml deleted file mode 100644 index 222303cf2..000000000 --- a/.github/workflows/spotlessApply.yml +++ /dev/null @@ -1,69 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Java CI with Gradle - -on: - push: - branches: [ "main" ] - pull_request: - - workflow_dispatch: - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - # Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. - # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - - name: Setup Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 - - - name: Build with Gradle Wrapper - run: ./gradlew spotlessApply - - # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). - # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. - # - # - name: Setup Gradle - # uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 - # with: - # gradle-version: '8.5' - # - # - name: Build with Gradle 8.5 - # run: gradle spotless apply - - dependency-submission: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. - # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md - - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 From 20387ffa1aee77bbe4c91bf887eaa102a9dffd83 Mon Sep 17 00:00:00 2001 From: Mixmix00 <68516760+Mixmix00@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:01:18 -0800 Subject: [PATCH 4/4] Update spotless.yml --- .github/workflows/spotless.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index cebb50ba0..fb52c1810 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -21,7 +21,7 @@ jobs: with: distribution: 'zulu' java-version: 17 - - name: Apply spotless linter - run: ./gradlew spotlessApply - - name: Run spotless linter check + + - run: ./gradlew spotlessApply + - run: ./gradlew spotlessCheck