From c9722a1d0dc009fc6c808d4b8c0979f9000cd619 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 20:38:43 +0800 Subject: [PATCH 01/14] add spotbugs in github actions Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 24 ++++++++++++++++++++++++ dev/spotbugs-include.xml | 1 + pom.xml | 7 ++++++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/spotbugs.yml diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml new file mode 100644 index 00000000000..cda8d18fd25 --- /dev/null +++ b/.github/workflows/spotbugs.yml @@ -0,0 +1,24 @@ +name: Spotbugs + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: mvn -B verify spotbugs:spotbugs -Dmaven.skip.test=true + - uses: jwgmeligmeyling/spotbugs-github-action@master + with: + path: '**/spotbugsXml.xml' \ No newline at end of file diff --git a/dev/spotbugs-include.xml b/dev/spotbugs-include.xml index 53d46131763..d29f338feb2 100644 --- a/dev/spotbugs-include.xml +++ b/dev/spotbugs-include.xml @@ -5,5 +5,6 @@ + diff --git a/pom.xml b/pom.xml index b3aa7c07e3b..f3c56f7ae7d 100644 --- a/pom.xml +++ b/pom.xml @@ -264,7 +264,7 @@ true target/site - dev/spotbugs-include.xml + dev/spotbugs-include.xml @@ -637,6 +637,11 @@ com.github.spotbugs spotbugs-maven-plugin 4.5.2.0 + + dev/spotbugs-include.xml + true + false + From 631ae3945ab2c9b2ac2903b34a3797b5e663316a Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 20:40:48 +0800 Subject: [PATCH 02/14] fix test ignore flag Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index cda8d18fd25..05faac143fb 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -18,7 +18,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Build with Maven - run: mvn -B verify spotbugs:spotbugs -Dmaven.skip.test=true + run: mvn -B verify spotbugs:spotbugs -Dmaven.test.skip=true - uses: jwgmeligmeyling/spotbugs-github-action@master with: path: '**/spotbugsXml.xml' \ No newline at end of file From 6280b037770415fbad72e6b76339d707ff6e115a Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 20:51:52 +0800 Subject: [PATCH 03/14] run spotbug with mvn Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 05faac143fb..e99e73528f1 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -6,19 +6,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Build with Maven - run: mvn -B verify spotbugs:spotbugs -Dmaven.test.skip=true - - uses: jwgmeligmeyling/spotbugs-github-action@master - with: - path: '**/spotbugsXml.xml' \ No newline at end of file + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + + - name: Run spotbugs + run: mvn clean spotbugs:check -Dmaven.test.skip=true From 4056eee7858255ae20c27c50358416e0f68526d6 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 20:53:16 +0800 Subject: [PATCH 04/14] add checkout Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index e99e73528f1..7242b10e03d 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -6,6 +6,7 @@ jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - name: Set up JDK 8 uses: actions/setup-java@v2 with: From fcd7761918022b7caeaeb3a8041c245b695bcbfc Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 20:57:14 +0800 Subject: [PATCH 05/14] use verify Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 7242b10e03d..5269f878fdd 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -14,4 +14,4 @@ jobs: distribution: 'adopt' - name: Run spotbugs - run: mvn clean spotbugs:check -Dmaven.test.skip=true + run: mvn -B verify spotbugs:check -Dmaven.test.skip=true From 6c049817227c2756f2438bf4fc7819cbf5342abc Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 21:07:32 +0800 Subject: [PATCH 06/14] use warning annotation Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 5 ++++- pom.xml | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 5269f878fdd..922dcd5192c 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -14,4 +14,7 @@ jobs: distribution: 'adopt' - name: Run spotbugs - run: mvn -B verify spotbugs:check -Dmaven.test.skip=true + run: | + if ! mvn -B verify spotbugs:check -Dmaven.test.skip=true; then + echo "::warning title=Violations detected" + fi diff --git a/pom.xml b/pom.xml index f3c56f7ae7d..95d05ddbf14 100644 --- a/pom.xml +++ b/pom.xml @@ -640,7 +640,6 @@ dev/spotbugs-include.xml true - false From e6500e55a856631ef5af53a1ff4aaf6adcfef274 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 21:32:20 +0800 Subject: [PATCH 07/14] test new process Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 922dcd5192c..59a29d31747 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -14,7 +14,8 @@ jobs: distribution: 'adopt' - name: Run spotbugs - run: | - if ! mvn -B verify spotbugs:check -Dmaven.test.skip=true; then - echo "::warning title=Violations detected" - fi + id: spotbugs + run: mvn -B verify spotbugs:check -Dmaven.test.skip=true; then + - name: Check spotbugs result + if: steps.spotbugs.output.exit_code != 0 + run: echo "::warning spotbugs found violations" From 4c88299d9ba5d1523db71e1f8f694e52ea908ff9 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 21:34:04 +0800 Subject: [PATCH 08/14] test new process Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 59a29d31747..cfc12b567f0 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -15,7 +15,7 @@ jobs: - name: Run spotbugs id: spotbugs - run: mvn -B verify spotbugs:check -Dmaven.test.skip=true; then + run: mvn -B verify spotbugs:check -Dmaven.test.skip=true - name: Check spotbugs result if: steps.spotbugs.output.exit_code != 0 run: echo "::warning spotbugs found violations" From c95f2cfc66b17a51a93fab59b7af42fbc0ffd5d7 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 21:44:31 +0800 Subject: [PATCH 09/14] test new process Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index cfc12b567f0..a76f7604f77 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -15,7 +15,7 @@ jobs: - name: Run spotbugs id: spotbugs - run: mvn -B verify spotbugs:check -Dmaven.test.skip=true - - name: Check spotbugs result - if: steps.spotbugs.output.exit_code != 0 - run: echo "::warning spotbugs found violations" + run: | + if ! mvn -B verify spotbugs:check -Dmaven.test.skip=true; then + echo '::warning title=Found violations::Please check the output log of spotbugs:check' + fi From 366e9b2977bb27513b18a3b6a8154e2d10bf5882 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 21:56:01 +0800 Subject: [PATCH 10/14] fail while reporting spotbugs error Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index a76f7604f77..eaed2c2865d 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -15,7 +15,4 @@ jobs: - name: Run spotbugs id: spotbugs - run: | - if ! mvn -B verify spotbugs:check -Dmaven.test.skip=true; then - echo '::warning title=Found violations::Please check the output log of spotbugs:check' - fi + run: mvn -B verify spotbugs:check -Dmaven.test.skip=true; then From e7ef169daf31a46641f575897dcd0ed21a855372 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 21:56:24 +0800 Subject: [PATCH 11/14] fail while reporting spotbugs error Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index eaed2c2865d..fbf69bc5baa 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -15,4 +15,4 @@ jobs: - name: Run spotbugs id: spotbugs - run: mvn -B verify spotbugs:check -Dmaven.test.skip=true; then + run: mvn -B verify spotbugs:check -Dmaven.test.skip=true From f560b3f93f115e417a1535bf7f71ac153b5a282c Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 23:03:40 +0800 Subject: [PATCH 12/14] use v1 Signed-off-by: iosmanthus --- .github/workflows/spotbugs.yml | 23 ++++++++++++++--------- pom.xml | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index fbf69bc5baa..1f6d7646dab 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -1,5 +1,4 @@ name: Spotbugs - on: [push] jobs: @@ -7,12 +6,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK 8 - uses: actions/setup-java@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 with: - java-version: '8' - distribution: 'adopt' - - - name: Run spotbugs - id: spotbugs - run: mvn -B verify spotbugs:check -Dmaven.test.skip=true + java-version: 1.8 + - uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: mvn -B verify spotbugs:spotbugs -Dmaven.test.skip=true + - uses: jwgmeligmeyling/spotbugs-github-action@v1 + with: + path: "**/spotbugsXml.xml" diff --git a/pom.xml b/pom.xml index 95d05ddbf14..f3c56f7ae7d 100644 --- a/pom.xml +++ b/pom.xml @@ -640,6 +640,7 @@ dev/spotbugs-include.xml true + false From d59938213dd347e7a8a95126d29e9a2d85bec461 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 9 Feb 2022 23:59:45 +0800 Subject: [PATCH 13/14] ignore patterns Signed-off-by: iosmanthus --- dev/spotbugs-include.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/spotbugs-include.xml b/dev/spotbugs-include.xml index d29f338feb2..9b0cad9b5cb 100644 --- a/dev/spotbugs-include.xml +++ b/dev/spotbugs-include.xml @@ -5,6 +5,12 @@ + + + + + + From 9968cde113b6765d02f790cdeb5c17b631b6f4b3 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Tue, 15 Feb 2022 13:49:21 +0800 Subject: [PATCH 14/14] format spotbugs-include.xml Signed-off-by: iosmanthus --- dev/spotbugs-include.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dev/spotbugs-include.xml b/dev/spotbugs-include.xml index 9b0cad9b5cb..2a075d749d2 100644 --- a/dev/spotbugs-include.xml +++ b/dev/spotbugs-include.xml @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + +