File tree 1 file changed +19
-3
lines changed 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 1
1
name : Build
2
- on : [push, pull_request]
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main", "develop" ] # Specify the branches to trigger on
6
+ pull_request :
7
+ branches : [ "main", "develop" ]
3
8
4
9
jobs :
5
10
build :
6
11
runs-on : ubuntu-latest
7
12
steps :
8
- - uses : actions/checkout@v4
13
+ - name : Checkout code
14
+ uses : actions/checkout@v4
15
+
9
16
- name : Set up JDK
10
17
uses : actions/setup-java@v4
11
18
with :
12
- java-version : 21
19
+ java-version : ' 21 '
13
20
distribution : ' temurin'
21
+
14
22
- name : Build with Maven
15
23
run : mvn --batch-mode --update-snapshots verify
24
+
25
+ - name : Run tests
26
+ run : mvn test # Adding a test step
27
+
16
28
- name : Upload coverage to codecov (tokenless)
17
29
if : >-
18
30
github.event_name == 'pull_request' &&
19
31
github.event.pull_request.head.repo.full_name != github.repository
20
32
uses : codecov/codecov-action@v4
21
33
with :
22
34
fail_ci_if_error : true
35
+
23
36
- name : Upload coverage to codecov (with token)
24
37
if : >
25
38
github.repository == 'TheAlgorithms/Java' &&
29
42
with :
30
43
token : ${{ secrets.CODECOV_TOKEN }}
31
44
fail_ci_if_error : true
45
+
32
46
- name : Checkstyle
33
47
run : mvn checkstyle:check
48
+
34
49
- name : SpotBugs
35
50
run : mvn spotbugs:check
51
+
36
52
- name : PMD
37
53
run : mvn pmd:check
You can’t perform that action at this time.
0 commit comments