Skip to content

Bump @wordpress/api-fetch from 6.4.0 to 7.14.0 #12

Bump @wordpress/api-fetch from 6.4.0 to 7.14.0

Bump @wordpress/api-fetch from 6.4.0 to 7.14.0 #12

name: Editor Integration Tests
on:
push:
# Only run if editor-related files changed.
paths:
- 'babel.config.cjs'
- 'karma-story-editor.config.cjs'
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.cjs'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
- '.github/workflows/tests-karma-editor.yml'
branches:
- main
- release/*
pull_request:
# Only run if editor-related files changed.
paths:
- 'babel.config.cjs'
- 'karma-story-editor.config.cjs'
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.cjs'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
- '.github/workflows/tests-karma-editor.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:
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)"
karma:
name: Karma (${{ matrix.shard }})
runs-on: ubuntu-latest
timeout-minutes: 60
needs: nonce
strategy:
matrix:
# We want to split up the tests into 4 parts running in parallel.
shard: ['1/4', '2/4', '3/4', '4/4']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
# TODO: Remove need for `npm install puppeteer`.
- name: Install dependencies
run: |
npm ci
npm install puppeteer
env:
PUPPETEER_PRODUCT: chrome
# FIXME: https://github.com/googleforcreators/web-stories-wp/issues/4364
- name: Increase max number of file watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- 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}"
- name: Run integration tests with Percy
run: |
npx percy exec --parallel --config=percy.config.karma.yml -- \
npm run test:karma:story-editor -- --headless --viewport=1600:1000 --coverage --shard=$SHARD || \
npx percy exec --parallel --config=percy.config.karma.yml -- \
npm run test:karma:story-editor:retry-failed -- --headless --viewport=1600:1000 --shard=$SHARD
env:
DISABLE_ERROR_BOUNDARIES: true
SHARD: ${{ matrix.shard }}
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_BROWSER_EXECUTABLE: ${{ steps.chromium_path.outputs.chromium_path }}
PERCY_PARALLEL_NONCE: ${{ needs.nonce.outputs.result }}
if: github.event.pull_request.draft == false
- name: Run integration tests
run: |
npm run test:karma:story-editor -- --headless --viewport=1600:1000 --coverage --shard=$SHARD || \
npm run test:karma:story-editor:retry-failed -- --headless --viewport=1600:1000 --shard=$SHARD
env:
DISABLE_ERROR_BOUNDARIES: true
SHARD: ${{ matrix.shard }}
if: github.event.pull_request.draft == true
- name: Upload code coverage report
uses: codecov/codecov-action@v3.1.0
with:
file: build/logs/karma-coverage/story-editor/lcov.info
flags: karmatests
percy:
name: Percy
runs-on: ubuntu-latest
timeout-minutes: 5
if: always() && github.event.pull_request.draft == false
needs: [karma, 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 }}
PERCY_PARALLEL_NONCE: ${{ needs.nonce.outputs.result }}