1+ name : pipeline-scheduled-run (daily 4:05 PM UTC)
2+
3+ on :
4+ schedule :
5+ - cron : " 5 17 * * *" # runs every day at 17:05 UTC (4:05 PM UTC)
6+
7+ jobs :
8+ run-test-job :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checking out the repo
12+ uses : actions/checkout@v4
13+
14+ - name : Cache Maven dependencies # adding this to speed up the execution, any changes in pom.xml file will result in cache miss
15+ id : maven-cache
16+ uses : actions/cache@v3
17+ with :
18+ path : ~/.m2/repository
19+ key : maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
20+
21+ - name : listing the files before running
22+ run : find .
23+
24+ - name : Build the project (compile and install)
25+ run : mvn clean install -DskipTests
26+
27+ - name : Running the test cases
28+ continue-on-error : true
29+ run : mvn clean test -Dsuite=vendor-portal.xml
30+
31+ - name : Printing the Test execution status
32+ if : always() # adding always() since this step will run always even if test cases run fail
33+ continue-on-error : true
34+ run : cat target/test-output/testng-report/TestSuite.txt
35+
36+ - name : Publishing the Test artifacts
37+ if : always()
38+ uses : actions/upload-artifact@v4
39+ with :
40+ name : test-reports-upload-extentReport
41+ path : target/test-output/extent-Report
42+ retention-days : 30 # for 30 days the report will persist after that it will be deleted, default is 90 days
43+
44+ download-test-report-job : # this will download the artifact
45+ needs : run-test-job
46+ runs-on : ubuntu-latest
47+ steps :
48+ - name : Download Test Reports
49+ uses : actions/download-artifact@v4
50+ with :
51+ name : test-reports-upload-extentReport
52+ path : test-execution-reports/
0 commit comments