File tree Expand file tree Collapse file tree
src/main/java/com/mycompany/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Java CI with Maven
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout repo
15+ uses : actions/checkout@v4
16+
17+ - name : Set up JDK 17
18+ uses : actions/setup-java@v4
19+ with :
20+ java-version : ' 17'
21+ distribution : ' temurin'
22+ cache : maven
23+
24+ - name : Build with Maven
25+ run : mvn -B -V -DskipTests=false verify
26+
27+ - name : Upload test results
28+ if : always()
29+ uses : actions/upload-artifact@v4
30+ with :
31+ name : test-results
32+ path : target/surefire-reports || target/failsafe-reports || target
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ The repository contains a simple Java application which outputs the string
99main application works as expected. The results of these tests are saved to a
1010JUnit XML report.
1111
12+ ## Continuous Integration
13+
14+ This repository includes a GitHub Actions workflow at ` .github/workflows/maven.yml ` that runs on push and pull requests to ` master ` .
15+ It uses JDK 17 and runs ` mvn -B verify ` , publishing test artifacts.
16+
1217The ` jenkins ` directory contains an example of the ` Jenkinsfile ` (i.e. Pipeline)
1318you'll be creating yourself during the tutorial and the ` jenkins/scripts ` subdirectory
1419contains a shell script with commands that are executed when Jenkins processes
Original file line number Diff line number Diff line change 1414 <version >5.11.0</version >
1515 <scope >test</scope >
1616 </dependency >
17+ <dependency >
18+ <groupId >org.junit.jupiter</groupId >
19+ <artifactId >junit-jupiter-engine</artifactId >
20+ <version >5.11.0</version >
21+ <scope >test</scope >
22+ </dependency >
1723 </dependencies >
1824 <properties >
1925 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
3238 </plugins >
3339 </pluginManagement >
3440 <plugins >
41+ <plugin >
42+ <groupId >org.apache.maven.plugins</groupId >
43+ <artifactId >maven-surefire-plugin</artifactId >
44+ <version >3.0.0-M9</version >
45+ <configuration >
46+ <useModulePath >false</useModulePath >
47+ </configuration >
48+ </plugin >
3549 <plugin >
3650 <!-- Build an executable JAR -->
3751 <groupId >org.apache.maven.plugins</groupId >
Original file line number Diff line number Diff line change 55 */
66public class App {
77
8- private static final String MESSAGE = "Hello World!" ;
8+ private static final String MESSAGE = "Hello World from Github Actions !" ;
99
1010 public App () {}
1111
You can’t perform that action at this time.
0 commit comments