Run our E2E tests on our generated release zip #155
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: | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
build: | |
uses: 10up/insecure-content-warning/.github/workflows/build-release-zip.yml@feature/release-e2e # TODO: Update this to develop branch. | |
cypress: | |
needs: build | |
name: ${{ matrix.core.name }} | |
runs-on: ubuntu-latest | |
if: always() | |
strategy: | |
matrix: | |
core: | |
- {name: 'WP latest', version: 'latest'} | |
- {name: 'WP minimum', version: 'WordPress/WordPress#6.4'} | |
- {name: 'WP trunk', version: 'WordPress/WordPress#master'} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download built zip | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: ${{ github.event.repository.name }} | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: ${{ github.event.repository.name }} | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache@v4 | |
id: cache-node | |
with: | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
path: | | |
node_modules | |
~/.cache | |
~/.npm | |
- run: npm ci | |
if: ${{ steps.cache-node.outputs.cache-hit != 'true' }} | |
- run: npm run build | |
- 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 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-artifact-insecure-content-warning | |
retention-days: 2 | |
path: | | |
${{ github.workspace }}/tests/cypress/screenshots/ | |
${{ github.workspace }}/tests/cypress/videos/ | |
${{ github.workspace }}/tests/cypress/logs/ |