-
Notifications
You must be signed in to change notification settings - Fork 2k
60 lines (49 loc) · 1.87 KB
/
editing-toolkit-plugin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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: Set up Node
uses: actions/setup-node@v1
with:
node-version: '^18.13.0'
- name: Checkout code
uses: actions/checkout@HEAD
- 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 --frozen-lockfile # Not needed when restoring from cache.
- name: Build packages
if: steps.cache.outputs.cache-hit == 'true'
run: yarn workspaces foreach --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