From 4d8cb1b1cc9cf96923412e6527d07ee63b73fb4d Mon Sep 17 00:00:00 2001 From: Jerven Bolleman Date: Fri, 16 Dec 2022 14:05:36 +0100 Subject: [PATCH 1/4] GH-4324 Separate out the formatting check into its own action Signed-off-by: Jerven Bolleman --- .github/workflows/pr-verify.yml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index a2e963b0f89..f2b6046320e 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -3,11 +3,11 @@ name: PR verify on: pull_request jobs: - build: + formatting: runs-on: ubuntu-latest strategy: matrix: - jdk: [11, 18] + jdk: 18 steps: - uses: actions/checkout@v2 - name: Set up JDK @@ -23,6 +23,31 @@ jobs: ${{ runner.os }}-jdk${{ matrix.jdk }}-maven- - name: Check formatting run: mvn -B formatter:validate impsort:check xml-format:xml-check + - name: Cancel workflow on failure + uses: vishnudxb/cancel-workflow@v1.2 + if: failure() + with: + repo: eclipse/rdf4j + workflow_id: ${{ github.run_id }} + access_token: ${{ github.token }} + build: + runs-on: ubuntu-latest + strategy: + matrix: + jdk: [11, 18] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.jdk }} + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-jdk${{ matrix.jdk }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-jdk${{ matrix.jdk }}-maven- - name: Build run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true - name: Test @@ -54,8 +79,6 @@ jobs: key: ${{ runner.os }}-jdk11-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-jdk11-maven- - - name: Check formatting - run: mvn -B formatter:validate impsort:check xml-format:xml-check - name: Build run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true - name: Verify @@ -87,8 +110,6 @@ jobs: key: ${{ runner.os }}-jdk11-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-jdk11-maven- - - name: Check formatting - run: mvn -B formatter:validate impsort:check xml-format:xml-check - name: Build run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true - name: Verify From e997f25d449ab54794c8506f51ecf5e2f8daa0dd Mon Sep 17 00:00:00 2001 From: Jerven Bolleman Date: Fri, 16 Dec 2022 14:08:23 +0100 Subject: [PATCH 2/4] GH-4324 Use java action v3 which has an easier maven cache setup Signed-off-by: Jerven Bolleman --- .github/workflows/pr-verify.yml | 40 +++++++-------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index f2b6046320e..542e18a7a92 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -11,16 +11,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.jdk }} - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-jdk${{ matrix.jdk }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-jdk${{ matrix.jdk }}-maven- + cache: 'maven' - name: Check formatting run: mvn -B formatter:validate impsort:check xml-format:xml-check - name: Cancel workflow on failure @@ -38,16 +32,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.jdk }} - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-jdk${{ matrix.jdk }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-jdk${{ matrix.jdk }}-maven- + cache: 'maven' - name: Build run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true - name: Test @@ -69,16 +57,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-jdk11-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-jdk11-maven- + cache: 'maven' - name: Build run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true - name: Verify @@ -100,16 +82,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-jdk11-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-jdk11-maven- + cache: 'maven' - name: Build run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true - name: Verify From caf32744ed62d06d92104af313146cdecd1d1768 Mon Sep 17 00:00:00 2001 From: Jerven Bolleman Date: Fri, 16 Dec 2022 14:13:41 +0100 Subject: [PATCH 3/4] GH-4324 Fix pr, use java 17 for formatting test change Signed-off-by: Jerven Bolleman --- .github/workflows/pr-verify.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 542e18a7a92..40fa0fd082d 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -5,15 +5,12 @@ on: pull_request jobs: formatting: runs-on: ubuntu-latest - strategy: - matrix: - jdk: 18 steps: - uses: actions/checkout@v2 - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: ${{ matrix.jdk }} + java-version: 17 cache: 'maven' - name: Check formatting run: mvn -B formatter:validate impsort:check xml-format:xml-check From 01db9783a7ecf997411bcacbade70460d7b53da6 Mon Sep 17 00:00:00 2001 From: Jerven Bolleman Date: Fri, 16 Dec 2022 14:20:21 +0100 Subject: [PATCH 4/4] GH-4324 Fix pr, new java action need distribution use the eclipse one Signed-off-by: Jerven Bolleman --- .github/workflows/pr-verify.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 40fa0fd082d..a66ebd54966 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -10,6 +10,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 17 cache: 'maven' - name: Check formatting @@ -31,6 +32,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: ${{ matrix.jdk }} cache: 'maven' - name: Build @@ -56,6 +58,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 11 cache: 'maven' - name: Build @@ -81,6 +84,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 11 cache: 'maven' - name: Build