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