1+ name : TWA Frontend Tests
2+ on :
3+ push :
4+ branches :
5+ - feat/migrate_twa_tests # Temp branch for testing
6+ pull_request :
7+ paths :
8+ - components/crud-web-apps/tensorboards/frontend/**
9+ - releasing/version/VERSION
10+ branches :
11+ - main
12+ - v*-branch
13+ - notebooks-v1
14+
15+ jobs :
16+ frontend-format-linting-check :
17+ name : Code format and lint
18+ runs-on : ubuntu-22.04
19+ defaults :
20+ run :
21+ working-directory : components/crud-web-apps/tensorboards/frontend
22+
23+ steps :
24+ - name : Checkout code
25+ uses : actions/checkout@v4
26+
27+ - name : Setup Node.js
28+ uses : actions/setup-node@v4
29+ with :
30+ node-version : 16
31+ cache : ' npm'
32+ cache-dependency-path : ' components/crud-web-apps/tensorboards/frontend/package-lock.json'
33+
34+ - name : Install dependencies
35+ run : npm ci
36+
37+ - name : Check code format
38+ run : npm run format:check
39+
40+ - name : Lint code
41+ run : npm run lint-check
42+
43+ build-common-lib :
44+ name : Build Kubeflow common library
45+ runs-on : ubuntu-22.04
46+ steps :
47+ - name : Checkout code
48+ uses : actions/checkout@v4
49+
50+ - name : Setup Node.js
51+ uses : actions/setup-node@v4
52+ with :
53+ node-version : 16
54+ cache : ' npm'
55+ cache-dependency-path : ' components/crud-web-apps/common/frontend/kubeflow-common-lib/package-lock.json'
56+
57+ - name : Install and build common library
58+ run : |
59+ cd components/crud-web-apps/common/frontend/kubeflow-common-lib
60+ npm ci
61+ npm run build
62+
63+ - name : Cache built common library
64+ uses : actions/cache@v4
65+ with :
66+ path : components/crud-web-apps/common/frontend/kubeflow-common-lib/dist
67+ key : kubeflow-common-lib-${{ github.sha }}
68+ restore-keys : |
69+ kubeflow-common-lib-
70+
71+ frontend-unit-tests :
72+ name : Unit tests
73+ runs-on : ubuntu-22.04
74+ needs : build-common-lib
75+ steps :
76+ - name : Checkout code
77+ uses : actions/checkout@v4
78+
79+ - name : Setup Node.js
80+ uses : actions/setup-node@v4
81+ with :
82+ node-version : 16
83+ cache : ' npm'
84+ cache-dependency-path : ' components/crud-web-apps/tensorboards/frontend/package-lock.json'
85+
86+ - name : Restore built common library
87+ uses : actions/cache@v4
88+ with :
89+ path : components/crud-web-apps/common/frontend/kubeflow-common-lib/dist
90+ key : kubeflow-common-lib-${{ github.sha }}
91+ restore-keys : |
92+ kubeflow-common-lib-
93+
94+ - name : Install common library dependencies
95+ run : |
96+ cd components/crud-web-apps/common/frontend/kubeflow-common-lib
97+ npm ci
98+ npm link ./dist/kubeflow
99+
100+ - name : Install TWA dependencies
101+ run : |
102+ cd components/crud-web-apps/tensorboards/frontend
103+ npm ci
104+ npm link kubeflow
105+
106+ - name : Run unit tests
107+ run : |
108+ cd components/crud-web-apps/tensorboards/frontend
109+ npm run test:prod
110+
111+ frontend-ui-tests :
112+ name : UI tests with Cypress
113+ runs-on : ubuntu-22.04
114+ needs : build-common-lib
115+ steps :
116+ - name : Checkout code
117+ uses : actions/checkout@v4
118+
119+ - name : Setup Node.js
120+ uses : actions/setup-node@v4
121+ with :
122+ node-version : 16
123+ cache : ' npm'
124+ cache-dependency-path : ' components/crud-web-apps/tensorboards/frontend/package-lock.json'
125+
126+ - name : Restore built common library
127+ uses : actions/cache@v4
128+ with :
129+ path : components/crud-web-apps/common/frontend/kubeflow-common-lib/dist
130+ key : kubeflow-common-lib-${{ github.sha }}
131+ restore-keys : |
132+ kubeflow-common-lib-
133+
134+ - name : Install common library dependencies
135+ run : |
136+ cd components/crud-web-apps/common/frontend/kubeflow-common-lib
137+ npm ci
138+ npm link ./dist/kubeflow
139+
140+ - name : Install TWA dependencies
141+ run : |
142+ cd components/crud-web-apps/tensorboards/frontend
143+ npm ci
144+ npm link kubeflow
145+
146+ - name : Run Cypress tests
147+ run : |
148+ cd components/crud-web-apps/tensorboards/frontend
149+ npm run serve > serve.log 2>&1 & npx wait-on http://localhost:4200
150+ npm run ui-test-ci-all
0 commit comments