File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Prepare WordPress
2+ description : Set up the WordPress repository.
3+ runs :
4+ using : composite
5+ steps :
6+ - name : Resolve WordPress cache key
7+ id : wordpress
8+ shell : bash
9+ env :
10+ # The setup script builds the "wordpress" folder and copies "db.copy" into it.
11+ SETUP_HASH : ${{ hashFiles( 'wp-setup.sh', 'packages/plugin-sqlite-database-integration/db.copy' ) }}
12+ run : |
13+ version="$( sed -n 's/^WP_VERSION="\(.*\)"$/\1/p' wp-setup.sh )"
14+ commit="$( git ls-remote --exit-code https://github.com/WordPress/wordpress-develop.git "refs/heads/$version" | cut -f1 )"
15+ echo "cache-key=wordpress-$( node --version )-$commit-$SETUP_HASH" >> "$GITHUB_OUTPUT"
16+
17+ - name : Restore WordPress from the cache
18+ id : cache
19+ uses : actions/cache/restore@v6
20+ with :
21+ path : wordpress
22+ key : ${{ steps.wordpress.outputs.cache-key }}
23+
24+ - name : Set up WordPress
25+ if : steps.cache.outputs.cache-hit != 'true'
26+ shell : bash
27+ run : composer run wp-test-ensure-php-env
28+
29+ # Save now rather than using "actions/cache", which saves at the end of the job.
30+ # Saving after the tests would also cache files they create, like the SQLite database.
31+ - name : Save WordPress to the cache
32+ if : steps.cache.outputs.cache-hit != 'true'
33+ uses : actions/cache/save@v6
34+ with :
35+ path : wordpress
36+ key : ${{ steps.wordpress.outputs.cache-key }}
Original file line number Diff line number Diff line change 2828 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
2929
3030 - name : Prepare WordPress
31- run : composer run wp-setup
31+ uses : ./.github/actions/wordpress
3232
3333 - name : Run end-to-end tests
3434 uses : ./.github/actions/playwright
Original file line number Diff line number Diff line change 3131 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
3232 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
3333
34+ - name : Prepare WordPress
35+ uses : ./.github/actions/wordpress
36+
3437 - name : Run SQLite plugin single-site PHPUnit tests
3538 run : composer run wp-test-sqlite-plugin-php
3639
Original file line number Diff line number Diff line change 2828 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
2929
3030 - name : Prepare WordPress
31- run : composer run wp-setup
31+ uses : ./.github/actions/wordpress
3232
3333 - name : Run WordPress end-to-end tests
3434 uses : ./.github/actions/playwright
Original file line number Diff line number Diff line change 2727 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
2828 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
2929
30+ - name : Prepare WordPress
31+ uses : ./.github/actions/wordpress
32+
3033 - name : Run WordPress PHPUnit tests
3134 run : node .github/workflows/wp-tests-phpunit-run.js
You can’t perform that action at this time.
0 commit comments