From 535d138d915dc2beb399579c2a039493c4e1b03f Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Sun, 14 Jan 2024 17:19:11 -0500 Subject: [PATCH] add commits to workflow to trigger unit tests --- .github/workflows/commit_workflow.yml | 38 +++++++++++++++++++ .../{main.yml => release_workflow.yml} | 0 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/commit_workflow.yml rename .github/workflows/{main.yml => release_workflow.yml} (100%) diff --git a/.github/workflows/commit_workflow.yml b/.github/workflows/commit_workflow.yml new file mode 100644 index 000000000..73b00d4ca --- /dev/null +++ b/.github/workflows/commit_workflow.yml @@ -0,0 +1,38 @@ +name: Commit Workflow + +on: + push: + branches: + - '*' + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 for x64 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + architecture: x64 + + - name: Run Tests + run: | + mvn test jacoco:report + working-directory: ${{ github.workspace }} + + - name: Check If All Tests Pass + run: | + if [ $? -eq 0 ]; then + echo "All tests passed successfully." + else + echo "Tests failed." + exit 1 # Exit with an error code to stop the workflow + fi + + - name: Save Geoweaver JaCoCo HTML Report + uses: actions/upload-artifact@v2 + with: + name: geoweaver-jacoco-coverage-report + path: target/site/jacoco diff --git a/.github/workflows/main.yml b/.github/workflows/release_workflow.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/release_workflow.yml