-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (74 loc) · 2.5 KB
/
integration-tests-frontend-ambient.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Integration Tests Frontend Ambient
on:
workflow_call:
inputs:
target_branch:
required: true
type: string
build_branch:
required: true
type: string
istio_version:
required: false
type: string
default: ""
env:
TARGET_BRANCH: ${{ inputs.target_branch }}
jobs:
integration_tests_frontend:
name: Cypress integration tests
runs-on: ubuntu-20.04
env:
# Copied from: https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L7-L11
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ inputs.build_branch }}
# This caches the yarn deps but does not touch node_modules so it's still necessary
# to run 'yarn install' later to link these into node_modules.
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "18"
cache: yarn
cache-dependency-path: frontend/yarn.lock
- name: Download go binary
uses: actions/download-artifact@v4
with:
name: kiali
path: ~/go/bin/
- name: Ensure kiali binary is executable
run: chmod +x ~/go/bin/kiali
- name: Download frontend build
uses: actions/download-artifact@v4
with:
name: build
path: frontend/build
# Need to install frontend dependencies to run cypress tests.
- name: Install frontend dependencies
working-directory: ./frontend
run: yarn install --frozen-lockfile
- name: Run frontend integration tests
run: hack/run-integration-tests.sh --test-suite frontend-ambient $(if [ -n "${{ inputs.istio_version }}" ]; then echo "--istio-version ${{ inputs.istio_version }}"; fi)
- name: Get debug info when integration tests fail
if: failure()
run: |
mkdir debug-output
hack/ci-get-debug-info.sh --output-directory debug-output
- name: Upload debug info artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: debug-info-${{ github.job }}
path: debug-output
- name: Upload cypress screenshots when tests fail
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots-${{ github.job }}
path: frontend/cypress/screenshots