From d3bf62320b704ffa055b07477eb3cc2b0604cdfe Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:09:13 +0800 Subject: [PATCH 01/24] update build.yml for report --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9b0a1f2e..be54dbd07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,8 @@ name: Build and Test on: push: - branches: [main] + branches: + - main jobs: build: @@ -16,10 +17,44 @@ jobs: uses: actions/setup-java@v2 with: java-version: '17' - distribution: 'adopt' - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn clean package - name: Run tests with Maven - run: mvn -B test --file pom.xml + run: mvn test + + # Store build artifacts for history + - name: Archive Build Artifacts + uses: actions/upload-artifact@v2 + with: + name: build-artifacts + path: target/ + + # Static Code Analysis with Checkstyle (Replace with your preferred tool) + - name: Static Code Analysis + run: | + # Install and run Checkstyle (replace with your tool) + # Example: mvn checkstyle:check + echo "Run your static code analysis tool here" + + # Store static code analysis reports + - name: Archive Static Code Analysis Reports + uses: actions/upload-artifact@v2 + with: + name: static-code-analysis-reports + path: path/to/static/code/analysis/reports + + # Code Coverage (Replace with your preferred tool) + - name: Code Coverage + run: | + # Run your code coverage tool here + # Example: mvn jacoco:report + echo "Run your code coverage tool here" + + # Store code coverage reports + - name: Archive Code Coverage Reports + uses: actions/upload-artifact@v2 + with: + name: code-coverage-reports + path: path/to/code/coverage/reports From 26fbe6473336687675403cb05b76e2c3f3066620 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:10:59 +0800 Subject: [PATCH 02/24] edit .yml to trigger build when commit to branch --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be54dbd07..632c78ab3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build and Test on: push: branches: - - main + - '*' jobs: build: From 714bc57b294962d558ac5ea91703192ed9684138 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:11:59 +0800 Subject: [PATCH 03/24] fix .yml for set up jdk --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 632c78ab3..d1533e62f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: uses: actions/setup-java@v2 with: java-version: '17' + distribution: 'adopt' - name: Build with Maven run: mvn clean package From 484fdc2344e0f78219add0ced23d531e0cc0302b Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:30:39 +0800 Subject: [PATCH 04/24] editted build.yml and pom.xml --- .github/workflows/build.yml | 85 +++++++++++++++++++------------------ pom.xml | 16 +++++-- 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1533e62f..35f2c1232 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,59 +3,60 @@ name: Build and Test on: push: branches: - - '*' + - "*" jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: "17" + distribution: "adopt" - - name: Build with Maven - run: mvn clean package + - name: Build with Maven + run: mvn clean package - - name: Run tests with Maven - run: mvn test + - name: Run tests with Maven + run: mvn test - # Store build artifacts for history - - name: Archive Build Artifacts - uses: actions/upload-artifact@v2 - with: - name: build-artifacts - path: target/ + # Store build artifacts for history + - name: Archive Build Artifacts + uses: actions/upload-artifact@v2 + with: + name: build-artifacts + path: target/ - # Static Code Analysis with Checkstyle (Replace with your preferred tool) - - name: Static Code Analysis - run: | - # Install and run Checkstyle (replace with your tool) - # Example: mvn checkstyle:check - echo "Run your static code analysis tool here" + # Static Code Analysis with Checkstyle + - name: Static Code Analysis with Checkstyle + run: | + # Install and run Checkstyle + mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle - # Store static code analysis reports - - name: Archive Static Code Analysis Reports - uses: actions/upload-artifact@v2 - with: - name: static-code-analysis-reports - path: path/to/static/code/analysis/reports + # Run Checkstyle + mvn checkstyle:check - # Code Coverage (Replace with your preferred tool) - - name: Code Coverage - run: | - # Run your code coverage tool here - # Example: mvn jacoco:report - echo "Run your code coverage tool here" + # Store static code analysis reports + - name: Archive Static Code Analysis Reports + uses: actions/upload-artifact@v2 + with: + name: static-code-analysis-reports + path: .github/workflows/reports/checkstyle/ - # Store code coverage reports - - name: Archive Code Coverage Reports - uses: actions/upload-artifact@v2 - with: - name: code-coverage-reports - path: path/to/code/coverage/reports + # Code Coverage + - name: Code Coverage + run: | + # Run JaCoCo report generation + mvn jacoco:report + + # Store code coverage reports + - name: Archive Code Coverage Reports + uses: actions/upload-artifact@v2 + with: + name: code-coverage-reports + path: .github/workflows/reports/jacoco/ diff --git a/pom.xml b/pom.xml index ce92ea579..f1c226cae 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 org.springframework.samples spring-petclinic @@ -33,6 +35,10 @@ 0.0.11 0.0.39 + + 1.16.3 + + @@ -166,7 +172,8 @@ - This build requires at least Java ${java.version}, update your JVM, and run the build again + This build requires at least Java ${java.version}, update your JVM, and + run the build again ${java.version} @@ -370,7 +377,8 @@ ${basedir}/src/main/scss/ ${basedir}/src/main/resources/static/resources/css/ - ${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/ + + ${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/ @@ -444,4 +452,4 @@ - + \ No newline at end of file From 3c8a12a856e687c7b94c4e8d50f3cff94255ade9 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:32:29 +0800 Subject: [PATCH 05/24] try again --- .github/workflows/build.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35f2c1232..8433ed0d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: build-artifacts - path: target/ + path: .github/workflows/reports/history/ # Static Code Analysis with Checkstyle - name: Static Code Analysis with Checkstyle diff --git a/pom.xml b/pom.xml index f1c226cae..c41bf6a51 100644 --- a/pom.xml +++ b/pom.xml @@ -416,7 +416,7 @@ - + ˇˇ org.springframework.boot spring-boot-maven-plugin From ceaa4934a087cd76f103b099ee8bea967bb0ed87 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:33:35 +0800 Subject: [PATCH 06/24] build test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8433ed0d9..13d353179 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build and Test on: push: branches: - - "*" + - '*' jobs: build: From 596a1179e26488e25792c16fd5aa2ff2ebb8be6e Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:35:48 +0800 Subject: [PATCH 07/24] build please --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13d353179..17306e0f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: "17" - distribution: "adopt" + java-version: '17' + distribution: 'adopt' - name: Build with Maven run: mvn clean package From 7eb5a735ca7338b6600490bfebe05d9927e43c26 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:38:10 +0800 Subject: [PATCH 08/24] hello? --- pom.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pom.xml b/pom.xml index c41bf6a51..578eee2e8 100644 --- a/pom.xml +++ b/pom.xml @@ -35,9 +35,6 @@ 0.0.11 0.0.39 - - 1.16.3 - From b80d549d7e651cb33295a4ba39b0b3f708f3c272 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:39:44 +0800 Subject: [PATCH 09/24] kq branch only --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17306e0f9..291026f37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,9 @@ name: Build and Test on: push: branches: - - '*' + - 'kq' + pull_request: + branches: [ main ] jobs: build: From f3ef9759793870f8ab8e3f2b493310a566501f13 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:42:30 +0800 Subject: [PATCH 10/24] change path --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 291026f37..4007ac231 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: build-artifacts - path: .github/workflows/reports/history/ + path: /spring-petclinic/reports/history/ # Static Code Analysis with Checkstyle - name: Static Code Analysis with Checkstyle @@ -48,7 +48,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: static-code-analysis-reports - path: .github/workflows/reports/checkstyle/ + path: /spring-petclinic/reports/checkstyle/ # Code Coverage - name: Code Coverage @@ -61,4 +61,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: code-coverage-reports - path: .github/workflows/reports/jacoco/ + path: /spring-petclinic/reports/jacoco/ From c3967cc2091c3c83c105174b122256c1b634840e Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 00:56:48 +0800 Subject: [PATCH 11/24] update pom.xml false failonviolation --- .github/workflows/build.yml | 2 +- pom.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4007ac231..e7bf8c51d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build and Test on: push: branches: - - 'kq' + - '*' pull_request: branches: [ main ] diff --git a/pom.xml b/pom.xml index 578eee2e8..4f790f1c9 100644 --- a/pom.xml +++ b/pom.xml @@ -217,6 +217,7 @@ ${basedir} **/* **/.git/**/*,**/.idea/**/*,**/target/**/,**/.flattened-pom.xml,**/*.class + false check From 27c73ce127c49069f493b8cb3039b151f6c3b307 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 01:05:09 +0800 Subject: [PATCH 12/24] test dont exit --- .github/workflows/build.yml | 6 +++--- pom.xml | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7bf8c51d..c4a51210c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: build-artifacts - path: /spring-petclinic/reports/history/ + path: target/ # Static Code Analysis with Checkstyle - name: Static Code Analysis with Checkstyle @@ -48,7 +48,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: static-code-analysis-reports - path: /spring-petclinic/reports/checkstyle/ + path: target/checkstyle-result.xml # Code Coverage - name: Code Coverage @@ -61,4 +61,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: code-coverage-reports - path: /spring-petclinic/reports/jacoco/ + path: target/site/jacoco/ diff --git a/pom.xml b/pom.xml index 4f790f1c9..b17d77958 100644 --- a/pom.xml +++ b/pom.xml @@ -195,6 +195,9 @@ org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle.version} + + false + com.puppycrawl.tools @@ -217,7 +220,6 @@ ${basedir} **/* **/.git/**/*,**/.idea/**/*,**/target/**/,**/.flattened-pom.xml,**/*.class - false check From 91a3135ce2ebead900e25f10919126c28e573a10 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 01:21:28 +0800 Subject: [PATCH 13/24] delete some code in .yml --- .github/workflows/build.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4a51210c..9f933ed3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,32 +33,3 @@ jobs: with: name: build-artifacts path: target/ - - # Static Code Analysis with Checkstyle - - name: Static Code Analysis with Checkstyle - run: | - # Install and run Checkstyle - mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle - - # Run Checkstyle - mvn checkstyle:check - - # Store static code analysis reports - - name: Archive Static Code Analysis Reports - uses: actions/upload-artifact@v2 - with: - name: static-code-analysis-reports - path: target/checkstyle-result.xml - - # Code Coverage - - name: Code Coverage - run: | - # Run JaCoCo report generation - mvn jacoco:report - - # Store code coverage reports - - name: Archive Code Coverage Reports - uses: actions/upload-artifact@v2 - with: - name: code-coverage-reports - path: target/site/jacoco/ From 54f589a12b6d8caa6231aa4edef21bbab83b00db Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 01:36:14 +0800 Subject: [PATCH 14/24] try release --- .github/workflows/build.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f933ed3a..2a5c9f686 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,9 @@ name: Build and Test on: push: branches: - - '*' + - "*" pull_request: - branches: [ main ] + branches: [main] jobs: build: @@ -18,8 +18,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '17' - distribution: 'adopt' + java-version: "17" + distribution: "adopt" - name: Build with Maven run: mvn clean package @@ -32,4 +32,15 @@ jobs: uses: actions/upload-artifact@v2 with: name: build-artifacts - path: target/ + path: + target/ + + # Create a release with the artifacts + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + files: | + target/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2228128ac884792501b4873404d7a04e9e9e0c6e Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 01:43:15 +0800 Subject: [PATCH 15/24] add tag for release --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a5c9f686..cae4a4684 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,8 @@ jobs: uses: softprops/action-gh-release@v1 with: files: | - target/* + target/*ß + tag_name: ${{ steps.get_tag.outputs.TAG }} + title: Release ${{ steps.get_tag.outputs.TAG }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ff1ef465a7c8bac0efc3a7ab4ff8fc897b0fdab7 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 01:50:03 +0800 Subject: [PATCH 16/24] try release again --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cae4a4684..814fd7257 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,9 +40,7 @@ jobs: id: create_release uses: softprops/action-gh-release@v1 with: - files: | - target/*ß + files: target/* tag_name: ${{ steps.get_tag.outputs.TAG }} - title: Release ${{ steps.get_tag.outputs.TAG }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 30597358408772c3cc57f4b951adbf5507716be1 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 02:01:19 +0800 Subject: [PATCH 17/24] release with tag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 814fd7257..8203cfac5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,4 +43,4 @@ jobs: files: target/* tag_name: ${{ steps.get_tag.outputs.TAG }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5863acecdfe2ff93bb39e17cbebb009bdf8f947d Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 02:04:04 +0800 Subject: [PATCH 18/24] forgot to tag --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8203cfac5..41d8e492d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,4 +43,5 @@ jobs: files: target/* tag_name: ${{ steps.get_tag.outputs.TAG }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file From c59fdcfa568e01954d0c77f073c18278fe56edd5 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 02:13:39 +0800 Subject: [PATCH 19/24] revert .yml and added comments --- .github/workflows/build.yml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41d8e492d..c41a706a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,45 +3,34 @@ name: Build and Test on: push: branches: - - "*" + - "*" # Trigger on all branches pull_request: - branches: [main] + branches: [main] # Trigger on pull requests to the 'main' branch jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # Use the latest version of Ubuntu as the runner steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v2 # Checkout your repository's code - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v2 # Set up Java Development Kit (JDK) version 17 with: java-version: "17" distribution: "adopt" - name: Build with Maven - run: mvn clean package + run: mvn clean package # Clean and package your Maven project - name: Run tests with Maven - run: mvn test + run: mvn test # Run tests using Maven # Store build artifacts for history - name: Archive Build Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow with: - name: build-artifacts + name: build-artifacts # Name for the uploaded artifacts path: - target/ - - # Create a release with the artifacts - - name: Create Release - id: create_release - uses: softprops/action-gh-release@v1 - with: - files: target/* - tag_name: ${{ steps.get_tag.outputs.TAG }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file + target/ # Path to the build artifacts (typically 'target/' for Maven) From efc36c2e93e4df3447092b9d1e74a35c948451db Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 04:15:20 +0800 Subject: [PATCH 20/24] test fail build --- .../springframework/samples/petclinic/vet/VetController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/vet/VetController.java b/src/main/java/org/springframework/samples/petclinic/vet/VetController.java index 3240814a6..f7e4f1325 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/VetController.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/VetController.java @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; * @author Arjen Poutsma */ @Controller -class VetController { +class VetControlle { private final VetRepository vetRepository; From 49ae440d0ac869d333993912308e7da9760b4610 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 04:20:14 +0800 Subject: [PATCH 21/24] revert --- .../springframework/samples/petclinic/vet/VetController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/vet/VetController.java b/src/main/java/org/springframework/samples/petclinic/vet/VetController.java index f7e4f1325..3240814a6 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/VetController.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/VetController.java @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; * @author Arjen Poutsma */ @Controller -class VetControlle { +class VetController { private final VetRepository vetRepository; From 97a261903a348db120894517159213219aa0b525 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Wed, 6 Sep 2023 04:31:22 +0800 Subject: [PATCH 22/24] add report code into .yml --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c41a706a2..031fec8ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,34 +3,63 @@ name: Build and Test on: push: branches: - - "*" # Trigger on all branches + - "*" # Trigger on all branches pull_request: - branches: [main] # Trigger on pull requests to the 'main' branch + branches: [main] # Trigger on pull requests to the 'main' branch jobs: build: - runs-on: ubuntu-latest # Use the latest version of Ubuntu as the runner + runs-on: ubuntu-latest # Use the latest version of Ubuntu as the runner steps: - name: Checkout code - uses: actions/checkout@v2 # Checkout your repository's code + uses: actions/checkout@v2 # Checkout your repository's code - name: Set up JDK 17 - uses: actions/setup-java@v2 # Set up Java Development Kit (JDK) version 17 + uses: actions/setup-java@v2 # Set up Java Development Kit (JDK) version 17 with: java-version: "17" distribution: "adopt" - name: Build with Maven - run: mvn clean package # Clean and package your Maven project + run: mvn clean package # Clean and package your Maven project - name: Run tests with Maven - run: mvn test # Run tests using Maven + run: mvn test # Run tests using Maven # Store build artifacts for history - name: Archive Build Artifacts - uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow + uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow with: - name: build-artifacts # Name for the uploaded artifacts + name: build-artifacts # Name for the uploaded artifacts path: - target/ # Path to the build artifacts (typically 'target/' for Maven) + target/ # Path to the build artifacts (typically 'target/' for Maven) + + + # Static Code Analysis with Checkstyle + - name: Static Code Analysis with Checkstyle + run: | + # Install and run Checkstyle + mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle + # Run Checkstyle + mvn checkstyle:check + + # Store static code analysis reports + - name: Archive Static Code Analysis Reports + uses: actions/upload-artifact@v2 + with: + name: static-code-analysis-reports + path: target/checkstyle-result.xml + + # Code Coverage + - name: Code Coverage + run: | + # Run JaCoCo report generation + mvn jacoco:report + + # Store code coverage reports + - name: Archive Code Coverage Reports + uses: actions/upload-artifact@v2 + with: + name: code-coverage-reports + path: target/site/jacoco/ From 7bfd3b9d515d9360c2d96a2267733310e177d18e Mon Sep 17 00:00:00 2001 From: KoonQi Date: Thu, 7 Sep 2023 15:24:17 +0800 Subject: [PATCH 23/24] final update on .yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 031fec8ee..74981629b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,6 @@ jobs: path: target/ # Path to the build artifacts (typically 'target/' for Maven) - # Static Code Analysis with Checkstyle - name: Static Code Analysis with Checkstyle run: | @@ -56,7 +55,7 @@ jobs: run: | # Run JaCoCo report generation mvn jacoco:report - + # Store code coverage reports - name: Archive Code Coverage Reports uses: actions/upload-artifact@v2 From d9bade79f6cc984fb15349d0f18498e6e33b6030 Mon Sep 17 00:00:00 2001 From: KoonQi Date: Thu, 7 Sep 2023 15:35:04 +0800 Subject: [PATCH 24/24] changed build and test a bit --- .github/workflows/build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74981629b..d9e2eb77e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,26 +21,28 @@ jobs: java-version: "17" distribution: "adopt" + - name: Build with Maven - run: mvn clean package # Clean and package your Maven project + run: mvn -B package --file pom.xml + # Build your project using Maven in non-interactive mode and specify the POM file. - name: Run tests with Maven - run: mvn test # Run tests using Maven + run: mvn -B test --file pom.xml + # Run tests using Maven in non-interactive mode and specify the POM file. # Store build artifacts for history - name: Archive Build Artifacts uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow with: name: build-artifacts # Name for the uploaded artifacts - path: - target/ # Path to the build artifacts (typically 'target/' for Maven) + path: target/ # Path to the build artifacts (typically 'target/' for Maven) # Static Code Analysis with Checkstyle - name: Static Code Analysis with Checkstyle run: | # Install and run Checkstyle mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle - # Run Checkstyle + # Run Checkstyle using Maven. mvn checkstyle:check # Store static code analysis reports @@ -48,7 +50,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: static-code-analysis-reports - path: target/checkstyle-result.xml + path: target/checkstyle-result.xml # Path to the Checkstyle report. # Code Coverage - name: Code Coverage @@ -61,4 +63,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: code-coverage-reports - path: target/site/jacoco/ + path: target/site/jacoco/ # Path to the code coverage report.