Skip to content

SBVT-2348: Updating deps #280

SBVT-2348: Updating deps

SBVT-2348: Updating deps #280

name: cypress-version-check
#on: [push]
on: [pull_request]
jobs:
cypress-run:
runs-on: ubuntu-latest
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 }}
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 }}
DEBUG: TRUE