-
-
Notifications
You must be signed in to change notification settings - Fork 763
98 lines (93 loc) · 3.13 KB
/
Copy pathjava.yml
File metadata and controls
98 lines (93 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Java
on:
pull_request:
paths:
- "**/*.java"
- "**/*.gradle"
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Check if tests compile cleanly with starter sources
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e
with:
java-version: 21
distribution: "temurin"
- name: Check if tests compile cleanly with starter sources
run: ./gradlew compileStarterTestJava --continue
working-directory: exercises
lint:
name: Lint Java files using Checkstyle
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up JDK 21
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e
with:
java-version: 21
distribution: "temurin"
- name: Run checkstyle
run: ./gradlew check --exclude-task test --continue
working-directory: exercises
test-all:
name: Test all exercises using java-test-runner
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Test all exercises using java-test-runner
run: bin/test-with-test-runner
- name: Print summary
run: |
if [ -f exercises/build/summary.txt ]; then
echo "===== TEST SUMMARY ====="
cat exercises/build/summary.txt
echo "========================"
else
echo "===== ALL TESTS PASSED ====="
echo "No summary file was generated."
echo "============================="
fi
if: always()
- name: Archive test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: test-results
path: exercises/**/build/results.json
if: failure()
test-changed:
name: Test changed exercises using gradlew
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
fetch-depth: 0
- name: Test changed exercises using java-test-runner
run: bin/test-changed-exercise
- name: Print summary
run: |
if [ -f exercises/build/summary.txt ]; then
echo "===== TEST SUMMARY ====="
cat exercises/build/summary.txt
echo "========================"
else
echo "===== ALL TESTS PASSED ====="
echo "No summary file was generated."
echo "============================="
fi
if: always()
- name: Archive test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: test-results
path: |
exercises/**/build/results.txt
exercises/**/build/results.json
if: failure()