File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,30 +19,30 @@ jobs:
1919 uses : actions/checkout@v4
2020 with :
2121 fetch-depth : 0
22-
22+
2323 - name : Set up JDK 17
2424 uses : actions/setup-java@v4
2525 with :
2626 java-version : ' 17'
2727 distribution : ' temurin'
28-
28+
2929 - name : Cache Maven local repository
3030 uses : actions/cache@v4
3131 with :
3232 path : ~/.m2/repository
3333 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
3434 restore-keys : |
3535 ${{ runner.os }}-maven-
36-
37- - name : Build (Maven)
38- run : mvn -B -DskipTests=false package
39-
40- - name : Run tests
41- run : mvn test -B
42-
43- - name : Upload build artifact (optional)
36+
37+ - name : Build and Test with Maven
38+ run : mvn -B clean package
39+ # 'package' phase includes: compile → test → package
40+ # Tests run automatically unless -DskipTests=true is specified
41+
42+ - name : Upload build artifact
4443 if : success()
4544 uses : actions/upload-artifact@v4
4645 with :
4746 name : mycmd-build
4847 path : target/*.jar
48+ retention-days : 7 # Auto-cleanup after 7 days
You can’t perform that action at this time.
0 commit comments