From a3d5144d9978ecd89f7ac462838b545a13d9b829 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Fri, 8 Mar 2024 18:15:55 -0300 Subject: [PATCH] try: run automated test in container --- .github/workflows/pr-checks.yml | 10 ++-------- package.json | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index e581ca22..ab4ce4e9 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -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 diff --git a/package.json b/package.json index 46e21dbc..d8f7899c 100644 --- a/package.json +++ b/package.json @@ -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",