Skip to content

Commit

Permalink
try: run automated test in container
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente Canales committed Mar 8, 2024
1 parent a206209 commit a3d5144
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,11 @@ jobs:
- name: Compile JavaScript App
run: npm run build

- name: Setup MySQL
if: success() || failure()
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'

- name: Run JavaScript unit tests
run: npm run test:unit

- name: Run PHP tests
run: |
mysql -uroot -h127.0.0.1 -e 'SELECT version()' \
npm run test:php:setup \
&& ./bin/install-wp-tests.sh --recreate-db wordpress_test root '' > /dev/null \
&& composer run-script test
&& wp-env run cli --env-cwd='wp-content/plugins/create-block-theme' composer run-script test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"lint:php:fix": "composer run-script format",
"lint:md-docs": "wp-scripts lint-md-docs",
"lint:pkg-json": "wp-scripts lint-pkg-json",
"test:php": "npm run lint:php && wp-env run cli --env-cwd='wp-content/plugins/create-block-theme' composer run-script test",
"test:php": "npm run test:php:setup && wp-env run cli --env-cwd='wp-content/plugins/create-block-theme' composer run-script test",
"test:php:setup": "wp-env start",
"packages-update": "wp-scripts packages-update",
"start": "wp-scripts start src/index.js src/plugin-sidebar.js src/wp-org-theme-directory.js",
Expand Down

0 comments on commit a3d5144

Please sign in to comment.