@@ -20,130 +20,9 @@ jobs:
2020 with :
2121 name : container
2222 path : container.tar
23- test :
24- needs : build
25- runs-on : ubuntu-latest
26- strategy :
27- fail-fast : false
28- matrix :
29- test : [a,b,c,d,e,f,g,h,i,j]
30- steps :
31- - uses : actions/checkout@v3
32- - uses : actions/download-artifact@v4
33- with :
34- name : container
35- - run : docker load -i container.tar
36- - name : Create docker network
37- run : docker network create --driver bridge --attachable data
38- - name : Start MariaDB
39- run : |
40- docker pull mariadb:10.8
41- docker run --name mariadbtest --network data -e MYSQL_ROOT_PASSWORD=secretpassword -p 3306:3306 -d mariadb:10.8
42- - name : Start rabbitmq
43- run : |
44- docker pull rabbitmq:latest
45- docker run -d --hostname my-rabbit --name some-rabbit --network data -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest
46- - name : Use Node.js
47- uses : actions/setup-node@v3
48- with :
49- node-version : 22
50- - name : yarn install
51- run : cd eform-client && yarn install
52- if : steps.cache.outputs.cache-hit != 'true'
53- - name : Create errorShots directory
54- run : mkdir eform-client/errorShots
55- - name : Wait for MariaDB
56- run : |
57- for i in {1..30}; do
58- if docker exec mariadb-test mysql -uroot -psecretpassword -e "SELECT 1" &>/dev/null; then
59- echo "MariaDB is ready!"
60- break
61- fi
62- echo "Waiting for MariaDB... ($i/30)"
63- sleep 2
64- done
65- - name : Start the newly build Docker container
66- id : docker-run
67- run : docker run --name my-container -p 4200:5000 --network data microtingas/frontend-container:latest "/ConnectionString=host=mariadbtest;Database=420_Angular;user=root;password=secretpassword;port=3306;Convert Zero Datetime = true;SslMode=none;" > docker_run_log 2>&1 &
68- - name : Sleep 15 seconds
69- run : sleep 15
70- - name : Get standard output
71- run : cat docker_run_log
72- - name : Pretest changes to work with Docker container
73- run : sed -i 's/localhost/mariadbtest/g' eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
74- - name : DB Configuration
75- uses : cypress-io/github-action@v5
76- with :
77- start : echo 'hi'
78- wait-on : " http://localhost:4200"
79- wait-on-timeout : 120
80- browser : chrome
81- record : false
82- spec : cypress/e2e/db/*
83- config-file : cypress.config.ts
84- working-directory : eform-client
85- command-prefix : " --"
86- - name : ${{matrix.test}} test
87- continue-on-error : true
88- uses : cypress-io/github-action@v4
89- with :
90- start : echo 'hi'
91- wait-on : " http://localhost:4200"
92- wait-on-timeout : 120
93- browser : chrome
94- record : false
95- spec : cypress/e2e/${{matrix.test}}/*
96- config-file : cypress.config.ts
97- working-directory : eform-client
98- command-prefix : " --"
99- - name : testheadless2${{matrix.test}}
100- run : cd eform-client && npm run testheadless2${{matrix.test}}
101- - name : Stop the newly build Docker container
102- run : docker stop my-container
103- - name : Get standard output
104- run : |
105- cat docker_run_log
106- result=`cat docker_run_log | grep "Now listening on: http://0.0.0.0:5000" -m 1 | wc -l`
107- if [ $result -ne 1 ];then exit 1; fi
108- - name : Stop mariadb
109- if : ${{ always() }}
110- continue-on-error : true
111- run : docker stop mariadbtest
112- - name : Stop rabbitmq
113- if : ${{ always() }}
114- continue-on-error : true
115- run : docker stop some-rabbit
116- - name : Remove old network
117- if : ${{ always() }}
118- continue-on-error : true
119- run : docker network rm data
120- - name : cleanup
121- if : ${{ always() }}
122- run : docker container prune --force
123- - name : The job has failed
124- if : ${{ failure() }}
125- run : |
126- cat docker_run_log
127- - name : Archive screenshot artifacts
128- if : ${{ failure() }}
129- uses : actions/upload-artifact@v4
130- with :
131- name : error Screenshots ${{matrix.test}}
132- path : |
133- /home/runner/work/eform-angular-frontend/eform-angular-frontend/eform-client/errorShots/*.png
134- retention-days : 2
135- - name : Archive video artifacts
136- if : ${{ always() }}
137- uses : actions/upload-artifact@v4
138- with :
139- name : cypress-videos-${{matrix.test}}
140- path : |
141- eform-client/cypress/videos/*.mp4
142- retention-days : 2
14323 playwright-test :
14424 needs : build
14525 runs-on : ubuntu-latest
146- continue-on-error : true
14726 strategy :
14827 fail-fast : false
14928 matrix :
19271 - name : Get standard output
19372 run : cat docker_run_log
19473 - name : Pretest changes to work with Docker container
195- run : |
196- sed -i 's/localhost/mariadbtest/g' eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
197- sed -i 's/localhost/mariadbtest/g' eform-client/playwright/e2e/Constants/DatabaseConfigurationConstants.ts
74+ run : sed -i 's/localhost/mariadbtest/g' eform-client/playwright/e2e/Constants/DatabaseConfigurationConstants.ts
19875 - name : DB Configuration
19976 run : cd eform-client && npx playwright test playwright/e2e/Tests/database-configuration/
20077 - name : Playwright ${{matrix.test}} test
0 commit comments