Skip to content

adds cypress split testing #37144

adds cypress split testing

adds cypress split testing #37144

name: Simorgh CI - Cypress E2E Tests
on:
create:
branches:
- '**'
pull_request:
branches:
- '**'
push:
branches:
- latest
permissions:
contents: read
jobs:
install:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Simorgh E2E Build
uses: cypress-io/github-action@v6
with:
runTests: false
build: yarn build
- name: Simorgh NextJS E2E Build
uses: cypress-io/github-action@v6
with:
working-directory: ws-nextjs-app
runTests: false
build: yarn build
- name: Save Simorgh E2E Build
uses: actions/upload-artifact@v4
with:
name: simorgh-build
if-no-files-found: error
path: build
- name: Save Simorgh NextJS E2E Build
uses: actions/upload-artifact@v4
with:
name: simorgh-nextjs-build
if-no-files-found: error
path: ws-nextjs-app/build
cypress-run:
runs-on: ubuntu-latest
needs: install
strategy:
fail-fast: false
matrix:
node-version: [18.x]
containers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
env:
CI: true
LOG_LEVEL: 'error'
CYPRESS_SKIP_EU: true
CYPRESS_SMOKE: true
BFF_PATH: 'https://web-cdn.test.api.bbci.co.uk/fd/simorgh-bff'
CYPRESS_APP_ENV: 'local'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Add bbc.com domain
run: sudo echo "127.0.0.1 localhost.bbc.com" | sudo tee -a /etc/hosts
- name: Download the Simorgh build folder
uses: actions/download-artifact@v4
with:
name: simorgh-build
path: build
- name: Download the Simorgh Next.js build folder
uses: actions/download-artifact@v4
with:
name: simorgh-nextjs-build
path: ws-nextjs-app/build
- name: List all files
run: ls -a && cp envConfig/local.env .env
- name: Run Simorgh E2Es
uses: cypress-io/github-action@v6
env:
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}
with:
install-command: yarn install
start: yarn start
- name: Run Simorgh NextJS E2Es
uses: cypress-io/github-action@v6
env:
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}
with:
working-directory: ws-nextjs-app
install-command: yarn install
start: yarn start