From 657a5029d4650d12208dc48700058c72b2447aa9 Mon Sep 17 00:00:00 2001 From: Eir Nym <485399+eirnym@users.noreply.github.com> Date: Mon, 9 Jan 2023 22:57:29 +0100 Subject: [PATCH 01/19] Add spotless check and build with tests --- .github/workflows/build-ci.yml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-ci.yml diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml new file mode 100644 index 0000000000..35df2e8d23 --- /dev/null +++ b/.github/workflows/build-ci.yml @@ -0,0 +1,46 @@ +on: + push: + branches: + - main + pull_request: + types: [assigned, opened, synchronize, reopened] + +jobs: + buildTest: + name: Build CI + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java_version: [11, 17] + distribution: ["temurin"] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} + uses: actions/setup-java@v3.9.0 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java_version }} + cache: gradle + - name: Build project + run: ./gradlew build -x spotlessCheck + spotless: + name: Check Spotless + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java_version: [11] + distribution: ["temurin"] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} + uses: actions/setup-java@v3.9.0 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java_version }} + cache: gradle + - name: Check spotless + run: ./gradlew spotlessCheck From fe801f0f3266762e466bdff4f399279202e81096 Mon Sep 17 00:00:00 2001 From: Eir Nym <485399+eirnym@users.noreply.github.com> Date: Mon, 9 Jan 2023 23:08:39 +0100 Subject: [PATCH 02/19] Full stacktrace on build jobs could be quite helpful --- .github/workflows/build-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 35df2e8d23..12e1b01410 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -24,7 +24,7 @@ jobs: java-version: ${{ matrix.java_version }} cache: gradle - name: Build project - run: ./gradlew build -x spotlessCheck + run: ./gradlew build -x spotlessCheck -S spotless: name: Check Spotless runs-on: ubuntu-latest @@ -43,4 +43,4 @@ jobs: java-version: ${{ matrix.java_version }} cache: gradle - name: Check spotless - run: ./gradlew spotlessCheck + run: ./gradlew spotlessCheck -S From 6289be94b37a0279ed3c3a90f969c2391faf084c Mon Sep 17 00:00:00 2001 From: Eir Nym <485399+eirnym@users.noreply.github.com> Date: Mon, 9 Jan 2023 23:12:53 +0100 Subject: [PATCH 03/19] Use fetch-depth:0 as workaround for spotlessCheck --- .github/workflows/build-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 12e1b01410..97f52dee00 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -36,6 +36,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} uses: actions/setup-java@v3.9.0 with: From 71661c18a35c2361ddfff12c77d0c3ac985b5b92 Mon Sep 17 00:00:00 2001 From: Eir Nym <485399+eirnym@users.noreply.github.com> Date: Mon, 9 Jan 2023 23:52:59 +0100 Subject: [PATCH 04/19] Add Windows CI --- .github/workflows/build-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 97f52dee00..a8c13ecf64 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -46,3 +46,22 @@ jobs: cache: gradle - name: Check spotless run: ./gradlew spotlessCheck -S + buildTestOnWindows: + name: Build on Windows CI + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + java_version: [11, 17] + distribution: ["temurin"] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} + uses: actions/setup-java@v3.9.0 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java_version }} + cache: gradle + - name: Build project + run: ./gradlew build -x spotlessCheck -S From 5fc8689e0cbcf6b4fff6bf5fd6e5c5e06f780e88 Mon Sep 17 00:00:00 2001 From: Eir Nym <485399+eirnym@users.noreply.github.com> Date: Mon, 9 Jan 2023 23:56:29 +0100 Subject: [PATCH 05/19] Fix editor config for yaml --- .editorconfig | 4 ++++ .github/workflows/build-ci.yml | 38 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6712fd66cc..1c19210c40 100644 --- a/.editorconfig +++ b/.editorconfig @@ -21,3 +21,7 @@ ij_java_names_count_to_use_import_on_demand = 999 [*.xml.mustache] indent_style = space + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index a8c13ecf64..ea12b03764 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -3,7 +3,7 @@ on: branches: - main pull_request: - types: [assigned, opened, synchronize, reopened] + types: [assigned, opened, synchronize, reopened] jobs: buildTest: @@ -47,21 +47,21 @@ jobs: - name: Check spotless run: ./gradlew spotlessCheck -S buildTestOnWindows: - name: Build on Windows CI - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - java_version: [11, 17] - distribution: ["temurin"] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} - uses: actions/setup-java@v3.9.0 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java_version }} - cache: gradle - - name: Build project - run: ./gradlew build -x spotlessCheck -S + name: Build on Windows CI + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + java_version: [11, 17] + distribution: ["temurin"] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} + uses: actions/setup-java@v3.9.0 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java_version }} + cache: gradle + - name: Build project + run: ./gradlew build -x spotlessCheck -S From 67f0db5c53b3877627e018c0b79bd93559cd9277 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:06:41 -0800 Subject: [PATCH 06/19] First steps in adapting #1477 to match #1472. --- .github/workflows/build-ci.yml | 67 ---------------------------------- .github/workflows/ci.yml | 43 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/build-ci.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml deleted file mode 100644 index ea12b03764..0000000000 --- a/.github/workflows/build-ci.yml +++ /dev/null @@ -1,67 +0,0 @@ -on: - push: - branches: - - main - pull_request: - types: [assigned, opened, synchronize, reopened] - -jobs: - buildTest: - name: Build CI - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java_version: [11, 17] - distribution: ["temurin"] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} - uses: actions/setup-java@v3.9.0 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java_version }} - cache: gradle - - name: Build project - run: ./gradlew build -x spotlessCheck -S - spotless: - name: Check Spotless - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java_version: [11] - distribution: ["temurin"] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} - uses: actions/setup-java@v3.9.0 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java_version }} - cache: gradle - - name: Check spotless - run: ./gradlew spotlessCheck -S - buildTestOnWindows: - name: Build on Windows CI - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - java_version: [11, 17] - distribution: ["temurin"] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} - uses: actions/setup-java@v3.9.0 - with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java_version }} - cache: gradle - - name: Build project - run: ./gradlew build -x spotlessCheck -S diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..53a1f49cf6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +# BUILDCACHE_USER +# BUILDCACHE_PASS +# - rw access to buildcache.diffplug.com + +on: [push, pull_request] +jobs: + testClasses: + name: spotlessCheck assemble testClasses + runs-on: ubuntu-latest + env: + buildcacheuser: ${{ secrets.BUILDCACHE_USER }} + buildcachepass: ${{ secrets.BUILDCACHE_PASS }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK 11 + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: 11 + cache: gradle + - name: Build project + run: ./gradlew spotlessCheck assemble testClasses --build-cache + test_windows: + needs: testClasses + name: test_windows + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + java_version: [17] + distribution: ["temurin"] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java_version }} + cache: gradle + - name: Build project + run: ./gradlew test --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true From b513d23dbe5839ba65ee04a05f58724f4a9cad1c Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:09:21 -0800 Subject: [PATCH 07/19] Fix spotless ratchetFrom --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53a1f49cf6..1282ef2a20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install JDK 11 uses: actions/setup-java@v3 with: From 8a69785b16cfccde04450a4454b2e9277d61bab5 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:26:31 -0800 Subject: [PATCH 08/19] Start running our tests also. --- .github/workflows/ci.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1282ef2a20..c6974d8de8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,15 +23,13 @@ jobs: cache: gradle - name: Build project run: ./gradlew spotlessCheck assemble testClasses --build-cache - test_windows: + check: needs: testClasses - name: test_windows - runs-on: windows-latest strategy: fail-fast: false - matrix: - java_version: [17] - distribution: ["temurin"] + maven_or_gradle: [maven, gradle] + os: [ubuntu-latest, windows-latest] + jre: [11, 17] steps: - name: Checkout uses: actions/checkout@v3 @@ -41,5 +39,9 @@ jobs: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java_version }} cache: gradle - - name: Build project - run: ./gradlew test --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true + - name: check maven + if: matrix.maven_or_gradle == 'maven' + run: ./gradlew :plugin-maven:check -x spotlessCheck --build-cache + - name: check everything but maven + if: matrix.maven_or_gradle == 'gradle' + run: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check -x spotlessCheck --build-cache From 0a120eceb177f4a3e78158a42bbc1fea66e250a3 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:28:05 -0800 Subject: [PATCH 09/19] Oops. Fix the matrix syntax. --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6974d8de8..7f0d8d5f7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,10 @@ jobs: needs: testClasses strategy: fail-fast: false - maven_or_gradle: [maven, gradle] - os: [ubuntu-latest, windows-latest] - jre: [11, 17] + matrix: + maven_or_gradle: [maven, gradle] + os: [ubuntu-latest, windows-latest] + jre: [11, 17] steps: - name: Checkout uses: actions/checkout@v3 From 136f96d350529407e860c665fb460d83b61dd4b3 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:33:07 -0800 Subject: [PATCH 10/19] Try again. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f0d8d5f7f..16952dca28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,14 +31,15 @@ jobs: maven_or_gradle: [maven, gradle] os: [ubuntu-latest, windows-latest] jre: [11, 17] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v3 - name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }} uses: actions/setup-java@v3 with: - distribution: ${{ matrix.distribution }} - java-version: ${{ matrix.java_version }} + distribution: "temurin" + java-version: ${{ matrix.jre }} cache: gradle - name: check maven if: matrix.maven_or_gradle == 'maven' From d0af06ef766bb8482c122749027a2f232a2e0cf0 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:43:57 -0800 Subject: [PATCH 11/19] Exclude maven from the assemble testClasses because it's not cacheable anyway. --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16952dca28..3bc9de5157 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,11 @@ jobs: distribution: "temurin" java-version: 11 cache: gradle - - name: Build project - run: ./gradlew spotlessCheck assemble testClasses --build-cache + - name: spotlessCheck + run: ./gradlew spotlessCheck --build-cache + - name: assemble testClasses + run: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew assemble testClasses --build-cache + # If this gets resolved, remove the EXCLUDE_MAVEN https://github.com/diffplug/spotless/issues/554 check: needs: testClasses strategy: From 692ad62635ab05b03955dea17406157f92ebb11d Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:54:41 -0800 Subject: [PATCH 12/19] Add java8 and npm tests. --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bc9de5157..b14769569b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,16 +24,16 @@ jobs: - name: spotlessCheck run: ./gradlew spotlessCheck --build-cache - name: assemble testClasses - run: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew assemble testClasses --build-cache + run: ./gradlew assemble testClasses --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true # If this gets resolved, remove the EXCLUDE_MAVEN https://github.com/diffplug/spotless/issues/554 check: needs: testClasses strategy: fail-fast: false matrix: - maven_or_gradle: [maven, gradle] + kind: [maven, gradle, npm] os: [ubuntu-latest, windows-latest] - jre: [11, 17] + jre: [8, 11, 17] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -45,8 +45,11 @@ jobs: java-version: ${{ matrix.jre }} cache: gradle - name: check maven - if: matrix.maven_or_gradle == 'maven' + if: matrix.kind == 'maven' run: ./gradlew :plugin-maven:check -x spotlessCheck --build-cache - name: check everything but maven - if: matrix.maven_or_gradle == 'gradle' - run: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check -x spotlessCheck --build-cache + if: matrix.kind == 'gradle' + run: ./gradlew check -x spotlessCheck --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true + - name: check npm + if: matrix.kind == 'npm' + run: ./gradlew testNpm --build-cache From a6c5dd48b902dcd013bed91d15f764ddd783458a Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 16:58:38 -0800 Subject: [PATCH 13/19] Change the matrix order a bit. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b14769569b..ac9d5be617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,8 @@ jobs: fail-fast: false matrix: kind: [maven, gradle, npm] - os: [ubuntu-latest, windows-latest] jre: [8, 11, 17] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout From 35a2dc9640b358f8dd74b3807434310ef76718e5 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 17:01:21 -0800 Subject: [PATCH 14/19] No more double-build by building only pushes to master. --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac9d5be617..9a34e0d42d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,10 @@ # BUILDCACHE_PASS # - rw access to buildcache.diffplug.com -on: [push, pull_request] +on: + pull_request: + push: + branches: [main] jobs: testClasses: name: spotlessCheck assemble testClasses From 71d0e85724beaede77f6c1d116ea2f1e7e13a2c2 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 17:09:08 -0800 Subject: [PATCH 15/19] Cancel in-progress builds that aren't working for us. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a34e0d42d..ed526a16ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: pull_request: push: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: testClasses: name: spotlessCheck assemble testClasses From d0faac2dda2c586e589f2f42e6754ebc7f789240 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 17:22:02 -0800 Subject: [PATCH 16/19] Switch from `check` to `build` --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed526a16ca..4ce6347755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - testClasses: + sanityCheck: name: spotlessCheck assemble testClasses runs-on: ubuntu-latest env: @@ -32,8 +32,8 @@ jobs: - name: assemble testClasses run: ./gradlew assemble testClasses --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true # If this gets resolved, remove the EXCLUDE_MAVEN https://github.com/diffplug/spotless/issues/554 - check: - needs: testClasses + build: + needs: sanityCheck strategy: fail-fast: false matrix: @@ -50,12 +50,12 @@ jobs: distribution: "temurin" java-version: ${{ matrix.jre }} cache: gradle - - name: check maven + - name: build (maven-only) if: matrix.kind == 'maven' - run: ./gradlew :plugin-maven:check -x spotlessCheck --build-cache - - name: check everything but maven + run: ./gradlew :plugin-maven:build -x spotlessCheck --build-cache + - name: build (everything-but-maven) if: matrix.kind == 'gradle' - run: ./gradlew check -x spotlessCheck --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true - - name: check npm + run: ./gradlew build -x spotlessCheck --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true + - name: testNpm if: matrix.kind == 'npm' run: ./gradlew testNpm --build-cache From 549558e05f661aab8ea2f2bf361f7a18af52ce51 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 17:50:06 -0800 Subject: [PATCH 17/19] Grab JUnit reports. --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ce6347755..63fc565b4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,12 @@ jobs: - name: build (everything-but-maven) if: matrix.kind == 'gradle' run: ./gradlew build -x spotlessCheck --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true - - name: testNpm + - name: test npm if: matrix.kind == 'npm' run: ./gradlew testNpm --build-cache + - name: junit result + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + check_name: JUnit ${{ matrix.kind }} ${{ matrix.jre }} ${{ matrix.os }} + report_paths: '*/build/test-results/*/TEST-*.xml' From 9cae4966b8b30c976c330c201d64ee6b453227d6 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 18:05:36 -0800 Subject: [PATCH 18/19] Be more efficient with runner minutes. --- .github/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63fc565b4a..2e302e6637 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,9 +37,21 @@ jobs: strategy: fail-fast: false matrix: - kind: [maven, gradle, npm] + kind: [maven, gradle] jre: [8, 11, 17] - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] + include: + # test windows at the diagonals of the above matrix + - kind: maven + jre: 8 + os: windows-latest + - kind: gradle + jre: 17 + os: windows-latest + # npm on linux only (crazy slow on windows) + - kind: npm + jre: 8 + os: ubuntu-latest runs-on: ${{ matrix.os }} steps: - name: Checkout From 6b67bf17b0d7b1887b0df1a3fb6d656b487ba9e8 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 14 Jan 2023 18:06:39 -0800 Subject: [PATCH 19/19] Fully remove CircleCI. --- .circleci/config.yml | 161 ------------------------------------------- 1 file changed, 161 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b9f91766c9..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,161 +0,0 @@ -version: 2.1 -orbs: - win: circleci/windows@5.0.0 - -anchors: - env_gradle: &env_gradle - environment: - # we're only allowed to use 2 vCPUs - GRADLE_OPTS: "-Dorg.gradle.workers.max=2" - docker: - - image: cimg/openjdk:11.0 - env_gradle_large: &env_gradle_large - << : *env_gradle - resource_class: large # https://circleci.com/docs/2.0/configuration-reference/#resource_class - environment: - GRADLE_OPTS: "-Dorg.gradle.workers.max=4" - - restore_cache_wrapper: &restore_cache_wrapper - restore_cache: - key: gradle-wrapper2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} - restore_cache_deps: &restore_cache_deps - restore_cache: - keys: - - gradle-deps3-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }} - - gradle-deps3- - set_git_origin_to_https: &set_git_origin_to_https - run: - name: set git origin to https - command: git remote set-url --push origin https://github.com/diffplug/spotless - - test_nomaven: &test_nomaven - steps: - - checkout - - *restore_cache_wrapper - - *restore_cache_deps - - run: - name: gradlew check -x spotlessCheck - command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check -x spotlessCheck --build-cache - - store_test_results: - path: testlib/build/test-results/test - - store_test_results: - path: lib-extra/build/test-results/test - - store_test_results: - path: plugin-gradle/build/test-results/test - - store_artifacts: - path: lib/build/spotbugs - - store_artifacts: - path: lib-extra/build/spotbugs - - store_artifacts: - path: testlib/build/spotbugs - - store_artifacts: - path: plugin-gradle/build/spotbugs - -jobs: - # gradlew spotlessCheck assemble testClasses - assemble_testClasses: - <<: *env_gradle_large - steps: - - checkout - - *restore_cache_wrapper - - *restore_cache_deps - - run: - name: gradlew spotlessCheck assemble testClasses - command: ./gradlew spotlessCheck assemble testClasses --build-cache - - save_cache: - paths: - - ~/.gradle/wrapper - key: gradle-wrapper2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }} - - save_cache: - paths: - - ~/.gradle/caches - - ~/.m2 - key: gradle-deps3-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }} - test_nomaven_11: - # latest LTS version - <<: *env_gradle_large - docker: - - image: cimg/openjdk:11.0 - <<: *test_nomaven - test_nomaven_17: - # latest JDK - <<: *env_gradle_large - docker: - - image: cimg/openjdk:17.0 - <<: *test_nomaven - test_justmaven_11: - << : *env_gradle - steps: - - checkout - - *restore_cache_wrapper - - *restore_cache_deps - - run: - name: gradlew :plugin-maven:check - command: ./gradlew :plugin-maven:check --build-cache - - store_test_results: - path: plugin-maven/build/test-results/test - test_npm_8: - << : *env_gradle - environment: - # java doesn't play nice with containers, it tries to hog the entire machine - # https://circleci.com/blog/how-to-handle-java-oom-errors/ - # try the experimental JVM option - _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" - docker: - - image: cimg/openjdk:8.0-node - steps: - - checkout - - *restore_cache_wrapper - - *restore_cache_deps - - run: - name: gradlew testNpm - command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew testNpm --build-cache - - store_test_results: - path: testlib/build/test-results/testNpm - - store_test_results: - path: plugin-maven/build/test-results/testNpm - - store_test_results: - path: plugin-gradle/build/test-results/testNpm - - run: - name: gradlew test - command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew test --build-cache - - store_test_results: - path: testlib/build/test-results/test - - store_test_results: - path: lib-extra/build/test-results/test - - store_test_results: - path: plugin-gradle/build/test-results/test - test_windows: - executor: - name: win/default - shell: cmd.exe - steps: - - checkout - - run: - name: gradlew test - command: gradlew test --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true - - store_test_results: - path: testlib/build/test-results/test - - store_test_results: - path: lib-extra/build/test-results/test - - store_test_results: - path: plugin-gradle/build/test-results/test - -workflows: - version: 2 - assemble_and_test: - jobs: - - test_windows - - assemble_testClasses - - test_justmaven_11: - requires: - - assemble_testClasses - - test_nomaven_11: - requires: - - assemble_testClasses - - test_nomaven_17: - requires: - - assemble_testClasses - - test_npm_8: - requires: - - assemble_testClasses