Skip to content

Bump eslint-plugin-import from 2.26.0 to 2.31.0 #20

Bump eslint-plugin-import from 2.26.0 to 2.31.0

Bump eslint-plugin-import from 2.26.0 to 2.31.0 #20

Workflow file for this run

name: E2E Tests
on:
push:
# Don't run for irrelevant changes.
paths-ignore:
- 'docs/**'
- '.storybook/**'
- '.wordpress-org/**'
- '__mocks__/**'
- '__static__/**'
- 'tests/**'
- '**.md'
- '**.yml'
- '**.neon.dist'
- '**.xml.dist'
- 'readme.txt'
- '.editorconfig'
- '.eslint*'
- '.markdownlint*'
- '.phpstorm.meta.php'
- '.prettier*'
- '.stylelint*'
- '.github/workflows/**'
- '!.github/workflows/tests-e2e.yml'
branches:
- main
- release/*
pull_request:
# Don't run for irrelevant changes.
paths-ignore:
- 'docs/**'
- '.storybook/**'
- '.wordpress-org/**'
- '__mocks__/**'
- '__static__/**'
- 'tests/**'
- '**.md'
- '**.yml'
- '**.neon.dist'
- '**.xml.dist'
- 'readme.txt'
- '.editorconfig'
- '.eslint*'
- '.markdownlint*'
- '.phpstorm.meta.php'
- '.prettier*'
- '.stylelint*'
- '.github/workflows/**'
- '!.github/workflows/tests-e2e.yml'
types:
- opened
- reopened
- synchronize
- ready_for_review
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build:
name: Build plugin
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none
tools: composer
- name: Install dependencies
run: npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: Install PHP dependencies
uses: 'ramsey/composer-install@v1'
with:
composer-options: '--prefer-dist --no-progress --no-interaction'
- name: Build plugin
run: npm run build:js
env:
# TODO: remove eventually
DISABLE_PREVENT: true
DISABLE_QUICK_TIPS: true
- name: Bundle plugin
run: npm run workflow:build-plugin
- name: Upload bundle
uses: actions/upload-artifact@v3
with:
name: web-stories
path: build/web-stories
nonce:
name: Percy Nonce
runs-on: ubuntu-latest
outputs:
result: ${{ steps.nonce.outputs.result }}
steps:
- id: nonce
run: echo "::set-output name=result::${{ github.run_id }}-$(date +%s)"
e2e:
name: '${{ matrix.browser }} - WP ${{ matrix.wp }} (${{ matrix.shard }})'
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: ${{ matrix.experimental == true }}
needs: [build, nonce]
strategy:
matrix:
# TODO: add back Firefox once support is more mature.
browser: ['chrome']
wp: ['5.5']
snapshots: [false]
# We want to split up the tests into 2 parts running in parallel.
shard: ['1/2', '2/2']
include:
- browser: 'chrome'
wp: 'latest'
snapshots: true
shard: '1/2'
- browser: 'chrome'
wp: 'latest'
snapshots: true
shard: '2/2'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download bundle
uses: actions/download-artifact@v3
with:
name: web-stories
# See https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
- name: Install libgbm1
run: sudo apt-get install libgbm1
- name: Install dependencies
run: npm install puppeteer
env:
PUPPETEER_PRODUCT: ${{ matrix.browser }}
- name: Start Docker environment
run: npm run env:start
env:
COMPOSE_INTERACTIVE_NO_CLI: true
WP_VERSION: ${{ matrix.wp }}
- name: Get Chromium executable path
id: chromium_path
run: |
CHROMIUM=$(node -p "const puppeteer = require('puppeteer'); puppeteer.executablePath();")
echo "::set-output name=chromium_path::${CHROMIUM}"
if: ( matrix.snapshots ) && ( github.event.pull_request.draft == false )
- name: Run E2E tests with percy
run: npm run test:e2e:percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_E2E }}
WP_VERSION: ${{ matrix.wp }}
PERCY_BROWSER_EXECUTABLE: ${{ steps.chromium_path.outputs.chromium_path }}
PERCY_PARALLEL_NONCE: ${{ needs.nonce.outputs.result }}
if: ( matrix.snapshots ) && ( github.event.pull_request.draft == false )
- name: Run E2E tests
run: npm run test:e2e
env:
WP_VERSION: ${{ matrix.wp }}
SHARD: ${{ matrix.shard }}
if: ( ! matrix.snapshots ) || ( github.event.pull_request.draft == true )
- name: Stop Docker environment
run: npm run env:stop
if: always()
env:
COMPOSE_INTERACTIVE_NO_CLI: true
percy:
name: Percy
runs-on: ubuntu-latest
timeout-minutes: 5
if: always() && github.event.pull_request.draft == false
needs: [e2e, nonce]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install dependencies
run: npm install @percy/cli
- name: Finalize Percy build
run: npx percy build:finalize
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_E2E }}
PERCY_PARALLEL_NONCE: ${{ needs.nonce.outputs.result }}