@@ -24,15 +24,11 @@ jobs:
2424 - name : Start Docker Services
2525 run : |
2626 docker compose -f .github/workflows/docker-compose-h2.yml up -d
27- sleep 15 # Wait for the ChainTest service to start completely
27+ sleep 15 # Wait for the service to initialize
2828
2929 # Step 4: Verify ChainTest service is running
30- - name : Verify ChainTest is Running
30+ - name : Verify ChainTest Service is Running
3131 run : curl --fail http://localhost:80/ || exit 1
32- env :
33- SPRING_PROFILES_ACTIVE : h2
34- SPRING_DATASOURCE_URL : jdbc:h2:file:./data/db
35- SPRING_DATASOURCE_DRIVERCLASSNAME : org.h2.Driver
3632
3733 # Step 5: Set up Java (Temurin 17)
3834 - name : Set up Java
4238 distribution : ' temurin'
4339
4440 # Step 6: Cache Maven packages for faster builds
45- - name : Cache Maven Packages
41+ - name : Cache Maven Dependencies
4642 uses : actions/cache@v4
4743 with :
4844 path : ~/.m2
@@ -54,40 +50,37 @@ jobs:
5450 - name : Install Dependencies
5551 run : mvn install -DskipTests
5652
57- # Step 8: Set up Xvfb (if GUI applications like Selenium require it )
53+ # Step 8: Set up Xvfb (for GUI-based tests, e.g., Selenium)
5854 - name : Set up Xvfb
5955 run : |
6056 sudo apt-get update
6157 sudo apt-get install -y xvfb
62- Xvfb :99 & # Start Xvfb on display :99
63- export DISPLAY=:99 # Set DISPLAY variable for GUI apps
58+ Xvfb :99 &
59+ export DISPLAY=:99
6460
65- # Step 9: Run Selenium tests
61+ # Step 9: Run Selenium Tests
6662 - name : Run Selenium Tests
67- run : |
68- export DISPLAY=:99 # Ensure DISPLAY is set
69- mvn test
63+ run : mvn test
7064 env :
71- DISPLAY : :99 # Ensure the same environment variable is available
65+ DISPLAY : :99
7266
73- # Step 10: Archive test reports
67+ # Step 10: Archive Test Reports
7468 - name : Archive Test Reports
7569 uses : actions/upload-artifact@v4
76- if : ${{ always() }} # Run this step even if tests fail
7770 with :
7871 name : Reports
79- path : target/chaintest/ # Archive the entire chaintest directory
72+ path : target/chaintest/ # Adjust this path if your reports are elsewhere
8073 retention-days : 7
8174
82- # Step 11: Stop Docker services
75+ # Step 11: Stop Docker Services
8376 - name : Stop Docker Services
8477 if : always()
8578 run : docker compose -f .github/workflows/docker-compose-h2.yml down
8679
8780 deploy-pages :
8881 name : Deploy Reports to GitHub Pages
8982 runs-on : ubuntu-latest
90- if : ${{ always() }} # Ensure this step runs even if tests fail
83+ if : ${{ always() }} # Runs even if previous job fails
9184 needs : run-tests
9285 permissions :
9386 contents : write
@@ -104,14 +97,14 @@ jobs:
10497 name : Reports
10598 path : ./target/chaintest
10699
107- # Step 3: Prepare reports for deployment
108- - name : Prepare Report for Deployment
100+ # Step 3: Prepare Reports for Deployment
101+ - name : Prepare Reports
109102 run : |
110103 mkdir -p public
111104 cp -R target/chaintest/* public/
112- mv public/Index.html public/index.html # Ensure index.html for GitHub Pages
105+ mv public/Index.html public/index.html
113106
114- # Step 4: Deploy reports to GitHub Pages
107+ # Step 4: Deploy to GitHub Pages
115108 - name : Deploy to GitHub Pages
116109 uses : peaceiris/actions-gh-pages@v3
117110 with :
0 commit comments