Skip to content

Commit bf807b4

Browse files
yehudit1987Yehudit Kerido
authored andcommitted
feat: Migrate TWA test-related workflows
Signed-off-by: Yehudit Kerido <[email protected]>
1 parent b8e44ca commit bf807b4

File tree

5 files changed

+600
-156
lines changed

5 files changed

+600
-156
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
29+
- name: Format tensorboards web app
30+
run: |
31+
npm ci
32+
npm run format:check
33+
34+
- name: Lint tensorboards web app
35+
run: |
36+
npm ci
37+
npm run lint-check
38+
39+
frontend-unit-tests:
40+
runs-on: ubuntu-22.04
41+
name: Unit tests
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
46+
- name: Setup node version to 16
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: 16
50+
51+
- name: Install common library dependencies
52+
run: |
53+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
54+
npm ci
55+
npm run build
56+
npm link ./dist/kubeflow
57+
58+
- name: Install TWA dependencies
59+
run: |
60+
cd components/crud-web-apps/tensorboards/frontend
61+
npm ci
62+
npm link kubeflow
63+
64+
- name: Run unit tests
65+
run: |
66+
cd components/crud-web-apps/tensorboards/frontend
67+
npm run test:prod
68+
69+
frontend-ui-tests:
70+
name: UI tests with Cypress
71+
runs-on: ubuntu-22.04
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+
81+
- name: Install common library dependencies
82+
run: |
83+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
84+
npm ci
85+
npm run build
86+
npm link ./dist/kubeflow
87+
88+
- name: Install TWA dependencies
89+
run: |
90+
cd components/crud-web-apps/tensorboards/frontend
91+
npm ci
92+
npm link kubeflow
93+
94+
- name: Serve UI & run Cypress tests in Chrome and Firefox
95+
run: |
96+
cd components/crud-web-apps/tensorboards/frontend
97+
npm run serve > serve.log 2>&1 & npx wait-on http://localhost:4200
98+
npm run ui-test-ci-all
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: TWA Integration Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/tensorboards/**
6+
- components/crud-web-apps/common/**
7+
- releasing/version/VERSION
8+
branches:
9+
- main
10+
- v*-branch
11+
- notebooks-v1
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
15+
cancel-in-progress: true
16+
17+
env:
18+
IMG: ghcr.io/kubeflow/notebooks/tensorboards-web-app
19+
TAG: integration-test
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Build TWA Image
29+
run: |
30+
cd components/crud-web-apps/tensorboards
31+
make docker-build
32+
33+
- name: Install KinD
34+
run: ./components/testing/gh-actions/install_kind.sh
35+
36+
- name: Create KinD Cluster
37+
run: kind create cluster --config components/testing/gh-actions/kind-1-25.yaml
38+
39+
- name: Load Image into KinD Cluster
40+
run: |
41+
kind load docker-image "${IMG}:${TAG}"
42+
43+
- name: Install kustomize
44+
run: ./components/testing/gh-actions/install_kustomize.sh
45+
46+
- name: Install Istio
47+
run: ./components/testing/gh-actions/install_istio.sh
48+
49+
- name: Build & Apply manifests
50+
run: |
51+
cd components/crud-web-apps/tensorboards/manifests
52+
kubectl create ns kubeflow
53+
54+
export CURRENT_IMAGE="${IMG}"
55+
export PR_IMAGE="${IMG}:${TAG}"
56+
57+
# escape "." in the image names, as it is a special characters in sed
58+
export CURRENT_IMAGE=$(echo "$CURRENT_IMAGE" | sed 's|\.|\\.|g')
59+
export PR_IMAGE=$(echo "$PR_IMAGE" | sed 's|\.|\\.|g')
60+
61+
kustomize build overlays/istio \
62+
| sed "s|${CURRENT_IMAGE}:[a-zA-Z0-9_.-]*|${PR_IMAGE}|g" \
63+
| kubectl apply -f -
64+
65+
kubectl wait pods -n kubeflow -l app=tensorboards-web-app --for=condition=Ready --timeout=300s
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: TWA Multi-Arch Build Test
2+
on:
3+
pull_request:
4+
paths:
5+
- components/crud-web-apps/tensorboards/**
6+
- components/crud-web-apps/common/**
7+
- releasing/version/VERSION
8+
branches:
9+
- main
10+
- v*-branch
11+
- notebooks-v1
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
15+
cancel-in-progress: true
16+
17+
env:
18+
IMG: ghcr.io/kubeflow/notebooks/tensorboards-web-app
19+
PLATFORMS: linux/amd64,linux/ppc64le,linux/arm64/v8
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Setup Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Build multi-arch images
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: components/crud-web-apps
38+
file: components/crud-web-apps/tensorboards/Dockerfile
39+
platforms: ${{ env.PLATFORMS }}
40+
tags: ${{ env.IMG }}:${{ github.sha }}
41+

0 commit comments

Comments
 (0)