Ensure that the insertBlock
command works properly in all cases.
#456
Workflow file for this run
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: E2E test | |
on: | |
push: | |
branches: [trunk, develop] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [develop] | |
schedule: | |
- cron: '36 7 * * 6' | |
jobs: | |
changed-files: | |
name: Changed Files | |
outputs: | |
status: ${{ steps.changed-files.outputs.any_changed }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: changed-files | |
uses: tj-actions/changed-files@v41 | |
with: | |
files: | | |
.github/workflows/cypress.yml | |
src/** | |
tests/** | |
cypress-wp-utils.php | |
.wp-env.json | |
package.json | |
package-lock.json | |
build: | |
name: Build | |
needs: changed-files | |
if: ${{ needs.changed-files.outputs.status == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache Node | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache | |
~/.npm | |
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }} | |
- name: Cache Build | |
uses: actions/cache@v3 | |
with: | |
path: lib | |
key: ${{ runner.os }}-build-${{ hashFiles('src/**') }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
cypress: | |
name: ${{ matrix.core.name }} | |
needs: [changed-files, build] | |
if: ${{ needs.changed-files.outputs.status == 'true' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
core: | |
- { | |
name: 'WP trunk', | |
version: 'WordPress/WordPress#master', | |
number: '6.6', | |
} | |
- { name: 'WP Latest', version: 'latest', number: '6.5' } | |
- { | |
name: 'WP 6.4', | |
version: 'WordPress/WordPress#6.4-branch', | |
number: '6.4', | |
} | |
- { | |
name: 'WP 6.3', | |
version: 'WordPress/WordPress#6.3-branch', | |
number: '6.3', | |
} | |
- { | |
name: 'WP 6.2', | |
version: 'WordPress/WordPress#6.2-branch', | |
number: '6.2', | |
} | |
- { | |
name: 'WP 6.1', | |
version: 'WordPress/WordPress#6.1-branch', | |
number: '6.1', | |
} | |
- { | |
name: 'WP 6.0', | |
version: 'WordPress/WordPress#6.0-branch', | |
number: '6.0', | |
} | |
- { | |
name: 'WP 5.9', | |
version: 'WordPress/WordPress#5.9-branch', | |
number: '5.9', | |
} | |
- { | |
name: 'WP 5.8', | |
version: 'WordPress/WordPress#5.8-branch', | |
number: '5.8', | |
} | |
- { | |
name: 'WP 5.7 (minimum)', | |
version: 'WordPress/WordPress#5.7-branch', | |
number: '5.7', | |
} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache Node | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache | |
~/.npm | |
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }} | |
- name: Cache Build | |
uses: actions/cache@v3 | |
with: | |
path: lib | |
key: ${{ runner.os }}-build-${{ hashFiles('src/**') }} | |
- name: Install Chrome | |
uses: browser-actions/setup-chrome@v1 | |
- name: Set the core version | |
run: ./tests/bin/set-core-version.js ${{ matrix.core.version }} | |
- name: Set up WP environment | |
run: npm run env:start | |
- name: Test | |
run: npm run cypress:run -- --browser chrome | |
env: | |
CYPRESS_WORDPRESS_CORE: ${{ matrix.core.number }} | |
- name: Update summary | |
run: | | |
npx mochawesome-merge ./tests/cypress/reports/*.json -o tests/cypress/reports/mochawesome.json | |
rm -rf ./tests/cypress/reports/mochawesome-*.json | |
npx mochawesome-json-to-md -p ./tests/cypress/reports/mochawesome.json -o ./tests/cypress/reports/mochawesome.md | |
npx mochawesome-report-generator tests/cypress/reports/mochawesome.json -o tests/cypress/reports/ | |
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY | |
- name: Make artifacts available | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-artifact-${{ matrix.core.number }} | |
retention-days: 2 | |
path: | | |
${{ github.workspace }}/tests/cypress/screenshots/ | |
${{ github.workspace }}/tests/cypress/videos/ | |
${{ github.workspace }}/tests/cypress/logs/ | |
${{ github.workspace }}/tests/cypress/reports/ |