Skip to content

Commit

Permalink
Fully reinstall WordPress between performance runs. This ensures ther…
Browse files Browse the repository at this point in the history
…e are no unwanted artifacts remaining in the database.
  • Loading branch information
johnbillion committed Jan 18, 2025
1 parent 0cae584 commit 0bdec8e
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,33 @@ jobs:
unzip ${{ github.workspace }}/before.zip
unzip -o ${{ github.workspace }}/wordpress.zip
- name: Run any database upgrades
if: ${{ steps.get-previous-build.outputs.result }}
run: npm run env:cli -- core update-db --path=/var/www/${{ env.LOCAL_DIR }}
- name: Re-install WordPress
run: npm run env:install

- name: Enable themes on Multisite
if: ${{ inputs.multisite }}
run: |
npm run env:cli -- theme enable twentytwentyone --network --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- theme enable twentytwentythree --network --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- theme enable twentytwentyfour --network --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- theme enable twentytwentyfive --network --path=/var/www/${{ env.LOCAL_DIR }}
- name: Activate WordPress Importer plugin
run: npm run env:cli -- plugin activate wordpress-importer --path=/var/www/${{ env.LOCAL_DIR }}

- name: Import mock data
run: |
curl -O https://raw.githubusercontent.com/WordPress/theme-test-data/b9752e0533a5acbb876951a8cbb5bcc69a56474c/themeunittestdata.wordpress.xml
npm run env:cli -- import themeunittestdata.wordpress.xml --authors=create --path=/var/www/${{ env.LOCAL_DIR }}
rm themeunittestdata.wordpress.xml
- name: Deactivate WordPress Importer plugin
run: npm run env:cli -- plugin deactivate wordpress-importer --path=/var/www/${{ env.LOCAL_DIR }}

- name: Flush cache
if: ${{ steps.get-previous-build.outputs.result }}
run: npm run env:cli -- cache flush --path=/var/www/${{ env.LOCAL_DIR }}

- name: Delete expired transients
if: ${{ steps.get-previous-build.outputs.result }}
run: npm run env:cli -- transient delete --expired --path=/var/www/${{ env.LOCAL_DIR }}

- name: Run target performance tests (previous/target commit)
if: ${{ steps.get-previous-build.outputs.result }}
env:
Expand Down

0 comments on commit 0bdec8e

Please sign in to comment.