Render Global Style notice only when necessary #5808
Workflow file for this run
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
on: | |
pull_request: | |
# only trigger this workflow if Editing Toolkit plugin files have been modified, or if packages have been updated. | |
paths: | |
- 'apps/editing-toolkit/**' | |
name: Editing Toolkit Plugin | |
jobs: | |
build: | |
name: Run PHPunit tests. | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@HEAD | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Composer install | |
uses: nick-zh/composer-php@HEAD | |
with: | |
action: 'install' | |
# https://github.com/actions/cache/blob/HEAD/examples.md#node---lerna | |
- name: Restore node_modules cache | |
id: cache | |
uses: actions/cache@HEAD | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-1 | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --immutable # Not needed when restoring from cache. | |
- name: Build packages | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: yarn workspaces foreach --all --parallel --verbose run postinstall # Needed only when not running yarn install. | |
- name: Build JavaScript | |
run: yarn build | |
working-directory: apps/editing-toolkit | |
- name: Setup wp-env dependencies | |
run: | | |
echo '{ "plugins": [ "./editing-toolkit-plugin", "https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip" ], "themes": [] }' > .wp-env.override.json | |
working-directory: apps/editing-toolkit | |
- name: Start wp-env | |
run: npx wp-env start || npx wp-env start # Retry if failed. | |
working-directory: apps/editing-toolkit | |
- name: Run phpunit command | |
run: yarn test:php | |
working-directory: apps/editing-toolkit |