File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Maven TestNG Automation Pipeline
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+ pull_request :
7+
8+ jobs :
9+ run-tests :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+
14+ # 1. Checkout code
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ # 2. Setup Java
19+ - name : Set up JDK 17
20+ uses : actions/setup-java@v4
21+ with :
22+ distribution : " temurin"
23+ java-version : " 17"
24+
25+ # 3. Cache Maven dependencies (speeds up builds)
26+ - name : Cache Maven packages
27+ uses : actions/cache@v4
28+ with :
29+ path : ~/.m2/repository
30+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31+ restore-keys : |
32+ ${{ runner.os }}-maven-
33+
34+ # 4. Run Maven Tests
35+ - name : Run TestNG tests
36+ run : mvn clean test
37+
38+ # 5. Upload ExtentReport (HTML)
39+ - name : Upload Extent Reports
40+ uses : actions/upload-artifact@v4
41+ with :
42+ name : extent-report
43+ path : |
44+ **/test-output/**
45+ **/ExtentReports/**
46+ **/extent-report/**
47+ **/reports/**
48+ retention-days : 7
You can’t perform that action at this time.
0 commit comments