Skip to content

Commit 5322edc

Browse files
committed
Enhance GitHub Actions workflow for Java tests
- Added a timeout of 15 minutes for the test job. - Implemented a fail-fast strategy in the job matrix. - Made the Maven wrapper executable before running tests. - Updated the test command to run only tests instead of a full build. - Added a step to upload test results with a retention period of 7 days. These changes improve the efficiency and clarity of the testing process.
1 parent e0e2ca1 commit 5322edc

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

.github/workflows/tests.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ jobs:
1313
run_tests:
1414
name: Run Tests
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 15
1617
env:
1718
DB_CONN_STR: ${{ vars.DB_CONN_STR }}
1819
DB_USERNAME: ${{ vars.DB_USERNAME }}
1920
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
2021
strategy:
22+
fail-fast: false
2123
matrix:
2224
java-version: ["17", "21"]
2325
steps:
24-
- name: Update repositories
25-
run: |
26-
sudo apt update || echo "apt-update failed" # && apt -y upgrade
27-
28-
- name: Checkout ${{ github.event.repository.name }}
26+
- name: Checkout repository
2927
uses: actions/checkout@v4
3028

3129
- name: Set up JDK ${{ matrix.java-version }}
@@ -35,11 +33,22 @@ jobs:
3533
distribution: "temurin"
3634
cache: "maven"
3735

36+
- name: Make Maven wrapper executable
37+
run: chmod +x mvnw
38+
3839
- name: Run Maven Tests
3940
id: run
40-
run: |
41-
chmod +x mvnw
42-
./mvnw clean install -DskipTests=false -Dmaven.javadoc.skip=true -Dgpg.skip=true -B -V -e
41+
run: ./mvnw clean test -B
42+
43+
- name: Upload test results
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: test-results-java-${{ matrix.java-version }}
48+
path: |
49+
target/surefire-reports/
50+
target/failsafe-reports/
51+
retention-days: 7
4352

4453
- name: Report Status
4554
if: always()

0 commit comments

Comments
 (0)