From dfb0672c0b0a0a2c46069da730da98078ad2d7ae Mon Sep 17 00:00:00 2001 From: GPTContribX <38401453+kiranraoboinapally@users.noreply.github.com> Date: Sat, 26 Apr 2025 08:43:05 +0530 Subject: [PATCH 1/3] Add test execution and upload test results in Maven CI workflow inside target/ Updated the GitHub Actions workflow to run unit tests after building the project and upload the test results as artifacts, even if the tests fail. This helps in easily identifying and debugging issues in the code. --- .github/workflows/maven-2.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-2.yml b/.github/workflows/maven-2.yml index be1f42e..68ccd08 100644 --- a/.github/workflows/maven-2.yml +++ b/.github/workflows/maven-2.yml @@ -30,7 +30,15 @@ jobs: - name: Build with Maven working-directory: latte run: mvn -B package --file pom.xml - + - name: Run tests with Maven + working-directory: latte + run: mvn test --file pom.xml + - name: Upload test results + if: always() # This ensures the test results are uploaded even if tests fail + uses: actions/upload-artifact@v2 + with: + name: test-results + path: latte/latte/target/test-*.xml # Maven Surefire generates the test result files here # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - name: Update dependency graph run: | From 2d5dc5c610d94fe1bfbb8049874531c74bbda782 Mon Sep 17 00:00:00 2001 From: GPTContribX <38401453+kiranraoboinapally@users.noreply.github.com> Date: Sat, 26 Apr 2025 08:48:21 +0530 Subject: [PATCH 2/3] v2 to v3 actions/upload-artifact@v3 --- .github/workflows/maven-2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-2.yml b/.github/workflows/maven-2.yml index 68ccd08..afcca41 100644 --- a/.github/workflows/maven-2.yml +++ b/.github/workflows/maven-2.yml @@ -35,7 +35,7 @@ jobs: run: mvn test --file pom.xml - name: Upload test results if: always() # This ensures the test results are uploaded even if tests fail - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: test-results path: latte/latte/target/test-*.xml # Maven Surefire generates the test result files here From fe8375d9485bde1ae082e23fad679ddab8c810cc Mon Sep 17 00:00:00 2001 From: GPTContribX <38401453+kiranraoboinapally@users.noreply.github.com> Date: Sat, 26 Apr 2025 08:51:13 +0530 Subject: [PATCH 3/3] Update maven-2.yml --- .github/workflows/maven-2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-2.yml b/.github/workflows/maven-2.yml index afcca41..dc67bfd 100644 --- a/.github/workflows/maven-2.yml +++ b/.github/workflows/maven-2.yml @@ -35,7 +35,7 @@ jobs: run: mvn test --file pom.xml - name: Upload test results if: always() # This ensures the test results are uploaded even if tests fail - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.6.2 with: name: test-results path: latte/latte/target/test-*.xml # Maven Surefire generates the test result files here