-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (97 loc) · 5.78 KB
/
cypress_version-test.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: cypress-version-check
#on: [push]
on: [pull_request]
jobs:
cypress-run:
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
cypress-version: [9.7.0, 10.11.0, 11.2.0, 12.13.0, 13.1.0, latest, dev]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract Branch Name and Set Test Run Name
id: set-test-run-name
run: |
BRANCH_NAME=$(echo "${{ github.ref }}" | awk -F'/' '{print $3}')
echo "::set-output name=TEST_RUN_NAME::${{ github.workflow }}:${{ matrix.cypress-version }}—$BRANCH_NAME"
- name: Install root dependencies
run: npm install
- name: Clear Cypress cache
run: |
sudo rm -rf $HOME/.cache/Cypress
# ************
# VERSION 10 and ABOVE
# ************
- name: Install test dependencies
if: ${{ startsWith(matrix.cypress-version, '10') || startsWith(matrix.cypress-version, '11') || startsWith(matrix.cypress-version, '12') || startsWith(matrix.cypress-version, 'dev') || startsWith(matrix.cypress-version, 'latest') }}
working-directory: ./test/version-control-test/above10
run: npm install
- name: "Install Cypress Version: ${{ matrix.cypress-version }}"
if: ${{ startsWith(matrix.cypress-version, '10') || startsWith(matrix.cypress-version, '11') || startsWith(matrix.cypress-version, '12') || startsWith(matrix.cypress-version, 'dev') || startsWith(matrix.cypress-version, 'latest') }}
working-directory: ./test/version-control-test/above10
run: npm install cypress@${{ matrix.cypress-version }}
- name: Setup visualtest
if: ${{ startsWith(matrix.cypress-version, '10') || startsWith(matrix.cypress-version, '11') || startsWith(matrix.cypress-version, '12') || startsWith(matrix.cypress-version, 'dev') || startsWith(matrix.cypress-version, 'latest') }}
working-directory: ./test/version-control-test/above10
run: npx visualtest-setup > visualtest-first-logs.txt
- name: Setup visualtest for second time
if: ${{ startsWith(matrix.cypress-version, '10') || startsWith(matrix.cypress-version, '11') || startsWith(matrix.cypress-version, '12') || startsWith(matrix.cypress-version, 'dev') || startsWith(matrix.cypress-version, 'latest') }}
working-directory: ./test/version-control-test/above10
run: npx visualtest-setup > visualtest-second-logs.txt
- name: Verify npx visualtest-setup
if: ${{ startsWith(matrix.cypress-version, '10') || startsWith(matrix.cypress-version, '11') || startsWith(matrix.cypress-version, '12') || startsWith(matrix.cypress-version, 'dev') || startsWith(matrix.cypress-version, 'latest') }}
working-directory: ./test/version-control-test/above10
run: npx jest
- name: Cypress run
if: ${{ startsWith(matrix.cypress-version, '10') || startsWith(matrix.cypress-version, '11') || startsWith(matrix.cypress-version, '12') || startsWith(matrix.cypress-version, 'dev') || startsWith(matrix.cypress-version, 'latest') }}
uses: cypress-io/github-action@v5
with:
quiet: true
working-directory: ./test/version-control-test/above10
spec: cypress/e2e/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE
# ************
# CYPRESS VERSIONS 7-9
# ************
- name: Install test dependencies
if: ${{ startsWith(matrix.cypress-version, '7') || startsWith(matrix.cypress-version, '8') || startsWith(matrix.cypress-version, '9') }}
working-directory: ./test/version-control-test/below10
run: npm install
- name: "Install Cypress Version: ${{ matrix.cypress-version }}"
if: ${{ startsWith(matrix.cypress-version, '7') || startsWith(matrix.cypress-version, '8') || startsWith(matrix.cypress-version, '9') }}
working-directory: ./test/version-control-test/below10
run: npm install cypress@${{ matrix.cypress-version }}
- name: Setup visualtest
if: ${{ startsWith(matrix.cypress-version, '7') || startsWith(matrix.cypress-version, '8') || startsWith(matrix.cypress-version, '9') }}
working-directory: ./test/version-control-test/below10
run: npx visualtest-setup > visualtest-first-logs.txt
- name: Setup visualtest for second time
if: ${{ startsWith(matrix.cypress-version, '7') || startsWith(matrix.cypress-version, '8') || startsWith(matrix.cypress-version, '9') }}
working-directory: ./test/version-control-test/below10
run: npx visualtest-setup > visualtest-second-logs.txt
- name: Verify npx visualtest-setup
if: ${{ startsWith(matrix.cypress-version, '7') || startsWith(matrix.cypress-version, '8') || startsWith(matrix.cypress-version, '9') }}
working-directory: ./test/version-control-test/below10
run: npx jest
- name: Cypress run
if: ${{ startsWith(matrix.cypress-version, '7') || startsWith(matrix.cypress-version, '8') || startsWith(matrix.cypress-version, '9') }}
uses: cypress-io/github-action@v5
with:
quiet: true
working-directory: ./test/version-control-test/below10
spec: cypress/integration/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE