POC for image background removal #1754
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 Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
# Cancels all previous workflow runs for the same branch that have not yet completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
e2e-tests: | |
name: E2E Tests (${{ matrix.wp }}${{ matrix.gb && ' + GB ' }}) (${{ matrix.shard }}) | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental == true }} | |
strategy: | |
fail-fast: false | |
matrix: | |
wp: ['latest'] | |
shard: ['1/4', '2/4', '3/4', '4/4'] | |
experimental: [false] | |
include: | |
- wp: 'trunk' | |
shard: '1/4' | |
experimental: true | |
- wp: 'trunk' | |
shard: '2/4' | |
experimental: true | |
- wp: 'trunk' | |
shard: '3/4' | |
experimental: true | |
- wp: 'trunk' | |
shard: '4/4' | |
experimental: true | |
- wp: 'trunk' | |
gb: true | |
shard: '1/4' | |
experimental: true | |
- wp: 'trunk' | |
gb: true | |
shard: '2/4' | |
experimental: true | |
- wp: 'trunk' | |
gb: true | |
shard: '3/4' | |
experimental: true | |
- wp: 'trunk' | |
gb: true | |
shard: '4/4' | |
experimental: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright browsers | |
run: npx playwright install --with-deps | |
- name: Build plugin | |
run: npm run build | |
env: | |
WP_DEVTOOL: source-map | |
# To get CSS source maps | |
NODE_ENV: development | |
- name: Start server | |
run: | | |
if [[ $WP_VERSION == 'trunk' ]]; then | |
echo "Using WordPress trunk" | |
echo "{\"core\":\"WordPress/WordPress#master\"}" >> .wp-env.override.json | |
fi | |
chmod -R 767 ./ | |
npm run wp-env start | |
if [[ $GUTENBERG != 'true' ]]; then | |
echo "Deactivating Gutenberg plugin" | |
npm run wp-env --silent -- run tests-cli wp plugin deactivate gutenberg | |
fi | |
env: | |
WP_VERSION: ${{ matrix.wp }} | |
GUTENBERG: ${{ matrix.gb == 'true' }} | |
- name: Run tests | |
run: | | |
npm run test:e2e -- --shard=${{ matrix.shard }} | |
env: | |
COLLECT_COVERAGE: ${{ matrix.wp == 'latest' }} | |
- name: Upload code coverage report | |
uses: codecov/[email protected] | |
with: | |
file: artifacts/e2e-coverage/coverage/codecov.json | |
flags: e2e | |
token: ${{ secrets.CODECOV_TOKEN }} | |
if: ${{ matrix.wp == 'latest' }} | |
- name: Get debug artifact name | |
if: always() | |
run: | | |
ARTIFACT_NAME=${ARTIFACT_NAME//\//-} | |
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV | |
env: | |
ARTIFACT_NAME: failures-artifacts-${{ matrix.wp }}${{ matrix.gb && '-gb' }}-${{ matrix.shard }} | |
- name: Archive debug artifacts (screenshots, HTML snapshots) | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: artifacts |