1+ name : Tests
2+ on :
3+ push :
4+ branches :
5+ - main
6+ - ' release-*'
7+ pull_request :
8+ branches :
9+ - main
10+ - ' release-*'
11+
12+ env :
13+ RANCHER_VERSION : head
14+ CATTLE_SERVER_URL : https://127.0.0.1
15+ CATTLE_BOOTSTRAP_PASSWORD : password
16+ API : https://127.0.0.1
17+ KUBECONFIG_PATH : ${{ github.workspace }}/kubeconfig.yaml
18+
19+ jobs :
20+ e2e :
21+ runs-on : ubuntu-latest
22+ steps :
23+ - uses : actions/checkout@v5
24+ with :
25+ fetch-depth : 1
26+
27+ - name : Setup Node env
28+ uses : ./.github/actions/setup
29+
30+ - name : Start Rancher
31+ run : .github/scripts/install-rancher.sh ${{ env.RANCHER_VERSION }} ${{ env.CATTLE_SERVER_URL }} ${{ env.CATTLE_BOOTSTRAP_PASSWORD }}
32+
33+ - name : Deploy AI Agent chart
34+ run : .github/scripts/deploy-ai-agent.sh ${{ env.KUBECONFIG_PATH }}
35+
36+ - name : Start Mock Agent
37+ working-directory : ./mock-agent
38+ run : |
39+ yarn install --frozen-lockfile
40+ nohup yarn mock:agent:start > mock-agent.log 2>&1 & echo $! > mock-agent.pid
41+
42+ - name : Start dev server
43+ env :
44+ API : ${{ env.API }}
45+ VUE_APP_AGENT_MESSAGES_WS_PATH : ws://localhost:8000/ws/agent
46+ run : |
47+ nohup yarn dev > dev.log 2>&1 & echo $! > dev.pid
48+
49+ - name : Wait for dev UI to be ready
50+ run : |
51+ npx wait-on https://localhost:8005
52+
53+ - name : Run Cypress tests
54+ id : cypress
55+ continue-on-error : true
56+ env :
57+ TEST_USERNAME : admin
58+ TEST_PASSWORD : ${{ env.CATTLE_BOOTSTRAP_PASSWORD }}
59+ CATTLE_BOOTSTRAP_PASSWORD : ${{ env.CATTLE_BOOTSTRAP_PASSWORD }}
60+ TEST_BASE_URL : https://localhost:8005
61+ TEST_SKIP : setup
62+ API : ${{ env.API }}
63+ run : |
64+ yarn e2e --browser chrome
65+
66+ - name : Upload videos on failure
67+ if : steps.cypress.outcome != 'success'
68+ uses : actions/upload-artifact@v4
69+ with :
70+ name : cypress-videos
71+ path : cypress/videos
72+ retention-days : 7
73+
74+ - name : Tear down background processes
75+ if : always()
76+ run : |
77+ if [ -f dev.pid ]; then kill $(cat dev.pid) || true; fi
78+ if [ -f mock-agent.pid ]; then kill $(cat mock-agent.pid) || true; fi
79+
80+ - name : Cypress failed
81+ if : steps.cypress.outcome != 'success'
82+ run : |
83+ echo "Cypress tests failed"
84+ exit 1
85+
86+ i18n :
87+ runs-on : ubuntu-latest
88+ steps :
89+ - uses : actions/checkout@v5
90+ with :
91+ fetch-depth : 1
92+
93+ - name : Run i18n lint
94+ uses : ./.github/actions/i18n-lint
95+
96+ lint :
97+ runs-on : ubuntu-latest
98+ steps :
99+ - uses : actions/checkout@v5
100+ with :
101+ fetch-depth : 1
102+
103+ - name : Run tests
104+ uses : ./.github/actions/lint
0 commit comments