Skip to content

Debug

Debug #111

name: Examples (branch)
on:
push:
branches-ignore:
- master
defaults:
run:
shell: bash
jobs:
find-examples:
runs-on: ubuntu-20.04
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
- run: npm -v
build-package:
runs-on: ubuntu-20.04
container:
image: cypress/base:20.5.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache NPM modules
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-linux@latest
- name: Cache Cypress binaries
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-linux@latest
- name: Change owner
run: "chown root: ."
- name: Dependencies
env:
CYPRESS_INSTALL_BINARY: "0"
run: |
npm install
- name: Build
run: npm run build
- name: Pack
run: npm pack
- name: Store dirty build
uses: actions/upload-artifact@v4
with:
name: build
path: badeball-*
example:
needs:
- find-examples
- build-package
runs-on: ubuntu-20.04
container:
image: cypress/base:20.5.0
strategy:
matrix:
example: ${{fromJson(needs.find-examples.outputs.matrix)}}
defaults:
run:
working-directory: examples/${{ matrix.example }}
env:
NPM_CONFIG_PACKAGE_LOCK: "false"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: examples/${{ matrix.example }}
- 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
- name: pwd
run: echo $PWD
- name: ls
run: ls -la
- name: Retrieve dirty build
uses: actions/download-artifact@v4
with:
name: build
- name: Install NPM modules
run: npm install
- name: Install dirty build
run: npm install badeball-*
- name: Run Cypress
run: |
if [[ "${{ matrix.example }}" == ct-* ]]; then
npx cypress run --component
else
npx cypress run --e2e
fi