Skip to content

v21.0.3

v21.0.3 #82

name: Examples (master)
on:
push:
branches:
- master
defaults:
run:
shell: bash
jobs:
find-examples:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set-matrix
name: Prepare
run: echo "matrix=$(node -p "JSON.stringify(fs.readdirSync('examples').filter(f => f !== 'readme.md'))")" >> $GITHUB_OUTPUT
example:
needs: find-examples
runs-on: ubuntu-latest
container:
image: cypress/base:latest
strategy:
fail-fast: false
matrix:
example: ${{fromJson(needs.find-examples.outputs.matrix)}}
env:
NPM_CONFIG_PACKAGE_LOCK: "false"
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Checkout
uses: actions/checkout@v4
- name: Cache NPM modules
uses: actions/cache@v4
with:
path: ~/.npm
key: npm@${{ matrix.example }}
- name: Cache Cypress binaries
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-examples
# In lack of native support, https://github.com/actions/checkout/issues/172.
- name: Make checkout sparse
run: |
shopt -s extglob
rm -rf examples/!(${{ matrix.example }})
rm -rf !(examples)
- name: Install NPM modules
working-directory: examples/${{ matrix.example }}
run: npm install --engine-strict
- name: Run Cypress
working-directory: examples/${{ matrix.example }}
run: |
if [[ "${{ matrix.example }}" == ct-* ]]; then
npx cypress run --component
else
npx cypress run --e2e
fi
- name: Versions
run: |
npx cypress --version
node --version
npm --version