Skip to content

Commit 3603bdf

Browse files
chore: switch to docker version
1 parent 2f4868c commit 3603bdf

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

.github/workflows/test-php.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,24 @@ jobs:
99
phpunit:
1010
name: Phpunit
1111
runs-on: ubuntu-22.04
12-
services:
13-
mysql:
14-
image: mysql:5.7
15-
env:
16-
MYSQL_ROOT_PASSWORD: root
17-
ports:
18-
- 3306/tcp
19-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2012
steps:
21-
- name: Setup PHP version
22-
uses: shivammathur/setup-php@v2
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
2315
with:
24-
php-version: "7.2"
25-
extensions: simplexml, mysql
26-
tools: phpunit-polyfills
27-
- name: Checkout source code
28-
uses: actions/checkout@v2
29-
- name: Install WordPress Test Suite
16+
node-version: "18"
17+
cache: "yarn"
18+
- name: Install NPM deps
19+
run: |
20+
yarn install --frozen-lockfile
21+
- name: Install composer deps
22+
run: composer install
23+
- name: Install environment
3024
run: |
31-
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
32-
- name: Install composer
33-
run: composer install --prefer-dist --no-progress --no-suggest
34-
- name: Run phpunit
35-
run: phpunit
25+
npm run wp-env start
26+
- name: Prepare Database
27+
run: bash ./bin/e2e-after-setup.sh
28+
- name: Run the tests
29+
run: |
30+
npm run test:unit:php
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

0 commit comments

Comments
 (0)