Skip to content

Run tests in parallel, add cypress record key #208

Run tests in parallel, add cypress record key

Run tests in parallel, add cypress record key #208

Workflow file for this run

name: Cypress Tests using Cypress Docker Image
on: push
jobs:
cypress-run:
runs-on: ubuntu-22.04
# Runs tests in parallel with matrix strategy https://docs.cypress.io/guides/guides/parallelization
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
# Also see warning here https://github.com/cypress-io/github-action#parallel
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
matrix:
containers: [1, 2] # Uses 2 parallel instances
container:
image: cypress/browsers:node-20.14.0-chrome-126.0.6478.114-1-ff-127.0.1-edge-126.0.2592.61-1
options: --user 1001
services:
meilisearch:
image: getmeili/meilisearch:latest
env:
MEILI_MASTER_KEY: "masterKey"
MEILI_NO_ANALYTICS: "true"
ports:
- "7700:7700"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: yarn
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
./playground/node_modules
key: ${{ hashFiles('playground/yarn.lock') }}
- name: Install dependencies
run: yarn --dev && yarn --cwd ./playground
- name: Build and link the package
run: |
npm install -g yalc
yarn build
yalc publish
cd playground
npx yalc add strapi-plugin-meilisearch
npx yalc link strapi-plugin-meilisearch
cd ..
yarn --cwd ./playground install
- name: Seed playground database
run: |
mkdir -p playground/.tmp
yarn playground:setup
- name: Run e2e browser tests
uses: cypress-io/github-action@v6
with:
build: yarn playground:build
start: yarn playground:dev
env: env=ci
browser: chrome
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
parallel: true # Runs test in parallel using settings above
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos