Bump wasm-bindgen from 0.2.92 to 0.2.93 #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Cypress on push | |
on: | |
push: | |
branches-ignore: | |
- main | |
workflow_dispatch: | |
jobs: | |
prepare_spec_files: | |
name: Prepage file list | |
runs-on: ubuntu-latest | |
outputs: | |
spec: ${{ steps.files.outputs.spec }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Files | |
id: files | |
run: | | |
# All the .cy.js files in the cypress/e2e directory in an array | |
ls cypress/e2e/*.cy.js | xargs -I{} basename {} .cy.js | jq -Rrs "split(\"\n\") | map(select(length > 0)) | tojson" | tee /tmp/spec.json | |
echo "spec=$(cat /tmp/spec.json)" >> "$GITHUB_OUTPUT" | |
npm_install: | |
name: Install Node modules | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
id: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install npm dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci | |
test: | |
name: WordPress (${{ matrix.spec }}) | |
needs: [prepare_spec_files, npm_install] | |
concurrency: | |
group: cypress - ${{ github.event.pull_request.number || github.ref }} - ${{ matrix.spec }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
spec: ${{ fromJson(needs.prepare_spec_files.outputs.spec) }} | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
- name: Restore node modules cache | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node-modules- | |
- name: Install wasm-pack | |
uses: qmaru/[email protected] | |
- name: Build | |
run: | | |
npm run lint | |
npm run build | |
- name: Start server | |
run: | | |
npx wp-env start | |
echo "WordPress version: `npx wp-env run cli core version`" | |
- name: Cypress run | |
uses: cypress-io/github-action@v5 | |
with: | |
browser: chrome | |
spec: cypress/e2e/${{ matrix.spec }}.cy.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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 |