Bump @wordpress/eslint-plugin from 17.11.0 to 22.0.0 #287
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: Performance Tests | |
on: | |
push: | |
branches-ignore: | |
- 'main-built' | |
pull_request: | |
jobs: | |
performance-tests: | |
name: 'Performance Tests' | |
runs-on: ubuntu-latest | |
env: | |
WP_BASE_URL: 'http://localhost:8888' | |
WP_USERNAME: 'admin' | |
WP_PASSWORD: 'password' | |
WP_AUTH_STORAGE: '.auth/wordpress.json' | |
WP_ARTIFACTS_PATH: ${{ github.workspace }}/artifacts | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: yarn | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Setup composer | |
uses: php-actions/composer@v6 | |
with: | |
php_version: '8.3' | |
dev: no | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build packages | |
run: yarn build | |
- name: Playwright install | |
run: yarn playwright install chromium | |
- name: Start wp-env | |
run: yarn wp-env | |
- name: Run tests | |
run: | | |
yarn test:performance | |
mv ${{ env.WP_ARTIFACTS_PATH }}/performance-results.json ${{ runner.temp }}/results_after.json | |
- name: Check out base commit | |
run: | | |
if [[ -z "$BASE_REF" ]]; then | |
git fetch -n origin $BASE_SHA | |
git reset --hard $BASE_SHA | |
else | |
git fetch -n origin $BASE_REF | |
git reset --hard $BASE_SHA | |
fi | |
env: | |
BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || '' }} | |
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} | |
# Run tests without causing job to fail if they don't pass (e.g. because of env issues). | |
- name: Run tests for base | |
run: | | |
npm run test:performance || true | |
if [ -f "{{ env.WP_ARTIFACTS_PATH }}/performance-results.json" ]; then | |
mv ${{ env.WP_ARTIFACTS_PATH }}/performance-results.json ${{ runner.temp }}/results_before.json | |
fi; | |
- name: Reset to original commit | |
run: | | |
git reset --hard $GITHUB_SHA | |
- name: Compare results with base | |
run: | | |
if [ -f "${{ runner.temp }}/results_before.json" ]; then | |
yarn test:performance:results ${{ runner.temp }}/results_after.json ${{ runner.temp }}/results_before.json | |
else | |
yarn test:performance:results ${{ runner.temp }}/results_after.json | |
fi; | |
- name: Add workflow summary | |
run: | | |
cat ${{ env.WP_ARTIFACTS_PATH }}/performance-results.md >> $GITHUB_STEP_SUMMARY | |
- name: Upload performance results | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: performance-results | |
path: ${{ env.WP_ARTIFACTS_PATH }}/performance-results.json |