Skip to content

Commit 9e67283

Browse files
Update project3_tests.yml
1 parent 91874da commit 9e67283

File tree

1 file changed

+9
-33
lines changed

1 file changed

+9
-33
lines changed

.github/workflows/project3_tests.yml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
java: [11]
14+
java: [17]
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4
@@ -21,51 +21,27 @@ jobs:
2121
with:
2222
distribution: temurin
2323
java-version: ${{ matrix.java }}
24-
25-
- name: Cache Gradle
26-
uses: actions/cache@v4
27-
with:
28-
path: |
29-
~/.gradle/caches
30-
~/.gradle/wrapper
31-
.gradle
32-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties','**/*.gradle*','**/build.gradle*') }}
33-
restore-keys: |
34-
${{ runner.os }}-gradle-
24+
cache: gradle
3525

3626
- name: Grant execute permission for gradlew
3727
run: chmod +x gradlew
3828

39-
- name: Run tests (auto-detect)
40-
run: |
41-
if [ -f settings.gradle ] || [ -f settings.gradle.kts ] ; then
42-
if grep -q "include ':app'" settings.gradle 2>/dev/null || grep -q "include(':app')" settings.gradle.kts 2>/dev/null || [ -d "app" ]; then
43-
./gradlew :app:testDebugUnitTest --no-daemon --stacktrace
44-
else
45-
./gradlew test --no-daemon --stacktrace
46-
fi
47-
else
48-
if [ -d "app" ]; then
49-
./gradlew :app:testDebugUnitTest --no-daemon --stacktrace
50-
else
51-
./gradlew test --no-daemon --stacktrace
52-
fi
53-
fi
29+
- name: Show Java version
30+
run: java -version
31+
32+
- name: Run tests
33+
run: ./gradlew test --no-daemon --stacktrace
5434

5535
- name: Upload test results
5636
if: always()
5737
uses: actions/upload-artifact@v4
5838
with:
5939
name: test-results
60-
path: |
61-
app/build/test-results
62-
build/test-results
40+
path: build/test-results
6341

6442
- name: Upload test reports
6543
if: always()
6644
uses: actions/upload-artifact@v4
6745
with:
6846
name: test-reports
69-
path: |
70-
app/build/reports/tests
71-
build/reports/tests
47+
path: build/reports/tests

0 commit comments

Comments
 (0)