Skip to content

Commit fbd2d46

Browse files
authored
Enhance GitHub Actions test workflow (#63)
- Added a timeout of 15 minutes to the test job to prevent long-running processes. - Implemented a fail-fast strategy in the job matrix to improve efficiency. - Made the Gradle wrapper executable as part of the workflow steps. - Updated the test execution command to simplify output and added a step to upload test results for better visibility. These changes improve the reliability and clarity of the testing process.
1 parent 1beb445 commit fbd2d46

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 }}
@@ -40,11 +38,22 @@ jobs:
4038
with:
4139
gradle-home-cache-cleanup: true
4240

41+
- name: Make Gradle wrapper executable
42+
run: chmod +x gradlew
43+
4344
- name: Run Gradle Tests
4445
id: run
45-
run: |
46-
chmod +x gradlew
47-
./gradlew clean test --info --stacktrace --configuration-cache
46+
run: ./gradlew clean test --stacktrace
47+
48+
- name: Upload test results
49+
if: always()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: test-results-java-${{ matrix.java-version }}
53+
path: |
54+
build/reports/tests/
55+
build/test-results/
56+
retention-days: 7
4857

4958
- name: Report Status
5059
if: always()

0 commit comments

Comments
 (0)