Skip to content

Bump @wordpress/components from 13.0.3 to 30.6.0 #228

Bump @wordpress/components from 13.0.3 to 30.6.0

Bump @wordpress/components from 13.0.3 to 30.6.0 #228

name: Editor Integration Tests
on:
push:
# Only run if editor-related files changed.
paths:
- 'assets/src/edit-story/**.js'
- 'babel.config.cjs'
- 'karma-edit-story.config.cjs'
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
branches:
- main
- release/*
pull_request:
# Only run if editor-related files changed.
paths:
- 'assets/src/edit-story/**.js'
- 'babel.config.cjs'
- 'karma-edit-story.config.cjs'
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
karma:
name: Karma
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Cancel previous
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
- name: Cache node modules
uses: pat-s/[email protected]
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
# TODO: Remove need for `npm install puppeteer`.
- name: Install dependencies
run: |
npm ci
npm install puppeteer
env:
CI: true
PUPPETEER_PRODUCT: chrome
# FIXME: https://github.com/google/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: Run integration tests
run: npm run test:karma:edit-story -- --headless --snapshots --viewport=1600:1000 --coverage || npm run test:karma:edit-story:retry-failed -- --headless --snapshots --viewport=1600:1000
env:
DISABLE_ERROR_BOUNDARIES: true
- name: Add files for snapshotting
run: cp -r __static__ .test_artifacts/karma_snapshots/
- name: Upload code coverage report
uses: codecov/codecov-action@v1
with:
file: build/logs/karma-coverage/edit-story/lcov.info
flags: karmatests
- name: Upload Percy snapshots
uses: percy/[email protected]
with:
build-directory: '.test_artifacts/karma_snapshots'
flags: '--config=percy.config.yml'
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
# The action cannot access the secret when run from a PR fork or authored by Dependabot.
if: >
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.fork == false &&
github.event.pull_request.user.login != 'dependabot[bot]'
- name: Upload CUJ coverage
uses: actions/upload-artifact@v2
with:
name: cuj-coverage-edit-story
path: build/cuj-coverage-edit-story.md
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
deploy-cuj-coverage:
name: Deploy CUJ Coverage
needs: [karma]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Download coverage file
uses: actions/download-artifact@v2
with:
name: cuj-coverage-edit-story
- name: Move file
run: |
mkdir -p critical-user-journeys
rm -rf critical-user-journeys/editor.md
mv cuj-coverage-edit-story.md critical-user-journeys/editor.md
- name: Commit updates
run: |
git add .
git status
git diff --staged --quiet && echo 'No changes to commit; exiting!' && exit 0
git commit -m "Deploy CUJ coverage for ${{ github.sha }}"
git pull --no-edit --quiet
git push origin gh-pages
env:
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_AUTHOR_NAME: ${{ github.actor }}
GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_COMMITTER_NAME: ${{ github.actor }}