44# Human readable name in the actions tab
55name : Java CI
66
7- # Build on every push and pull request regardless of the branch
7+ # Build on every pull request regardless of the branch
88# Wiki: https://help.github.com/en/actions/reference/events-that-trigger-workflows
99on :
10- - push
11- - pull_request
10+ push :
11+ branches :
12+ - main
13+ pull_request :
14+ branches :
15+ - main
1216
1317jobs :
1418 # job id
@@ -19,32 +23,32 @@ jobs:
1923
2024 # Run steps
2125 steps :
22- # Pull changes
23- 24-
25- # Cache artifacts - however this has the downside that we don't get notified of
26- # artifact resolution failures like invalid repository
27- # Nevertheless the repositories should be more stable and it makes no sense to pull
28- # a same version every time
29- # A dry run would make more sense
30- 31- with :
32- path : ~/.m2/repository
33- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
34- restore-keys : |
35- ${{ runner.os }}-maven-
36-
37- # Setup Java
38- - name : Set up JDK
39- 40- with :
41- distribution : ' adopt'
42- # Use Java 11, because it's minimum required version
43- java-version : 11
44-
45- # Build and test (included in package)
46- - name : Build with Maven and test
47- # Run non-interactive, package (with compile+test),
48- # ignore snapshot updates, because they are likely to have breaking changes, enforce checksums to validate
49- # possible errors in dependencies
50- run : mvn test --batch-mode --no-snapshot-updates --strict-checksums --file pom.xml
26+ # Pull changes
27+ 28+
29+ # Cache artifacts - however this has the downside that we don't get notified of
30+ # artifact resolution failures like invalid repository
31+ # Nevertheless the repositories should be more stable and it makes no sense to pull
32+ # a same version every time
33+ # A dry run would make more sense
34+ 35+ with :
36+ path : ~/.m2/repository
37+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
38+ restore-keys : |
39+ ${{ runner.os }}-maven-
40+
41+ # Setup Java
42+ - name : Set up JDK
43+ 44+ with :
45+ distribution : ' adopt'
46+ # Use Java 11, because it's minimum required version
47+ java-version : 11
48+
49+ # Build and test (included in package)
50+ - name : Build with Maven and test
51+ # Run non-interactive, package (with compile+test),
52+ # ignore snapshot updates, because they are likely to have breaking changes, enforce checksums to validate
53+ # possible errors in dependencies
54+ run : mvn test --batch-mode --no-snapshot-updates --strict-checksums --file pom.xml
0 commit comments