Skip to content

Run All Tests Headless #54

Run All Tests Headless

Run All Tests Headless #54

Workflow file for this run

# https://github.com/marketplace/actions/cypress-io
name: Run All Tests Headless
on:
workflow_dispatch:
inputs:
ru:
description: The variable to be passed
required: false
default: TEST
schedule:
- cron: 0 7 * * 1
jobs:
reusable-steps:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.14.2
- name: Update & Install Ubuntu packages
run: |
env
sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
- name: Update & Install NPM packages
run: |
npx browserslist@latest --update-db
npm ci
- name: Clear Report
run: |
echo "Clear the report"
npm run delete-mochawesome-report
npm run delete-results
run-tests:
runs-on: ubuntu-latest
needs: reusable-steps
strategy:
fail-fast: false
matrix:
containers: [1, 2] # Uses 2 parallel instances
steps:
# Include reusable steps from above
- name: 'Run reusable steps'
uses: ./.github/workflows/setup.yml
- name: Run Tests
uses: cypress-io/github-action@v6
with:
browser: chrome
spec: 'cypress/e2e/**/*' # Run all tests. Same as empty string ''
env:
CYPRESS_RU: ${{ github.event.inputs.ru }}
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}
# CYPRESS_BASE_URL: '' # Fil in new baseUrl with https prefix
- name: Prepare report
if: success() || failure()
run: |
mkdir -p cypress/results/
cp -r cypress/reports/html/* cypress/results/
- name: Archive results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
cypress/results/**