Skip to content

Commit

Permalink
chore: switch to docker version
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Oct 16, 2024
1 parent 2f4868c commit 3603bdf
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,24 @@ jobs:
phpunit:
name: Phpunit
runs-on: ubuntu-22.04
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
php-version: "7.2"
extensions: simplexml, mysql
tools: phpunit-polyfills
- name: Checkout source code
uses: actions/checkout@v2
- name: Install WordPress Test Suite
node-version: "18"
cache: "yarn"
- name: Install NPM deps
run: |
yarn install --frozen-lockfile
- name: Install composer deps
run: composer install
- name: Install environment
run: |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
- name: Install composer
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run phpunit
run: phpunit
npm run wp-env start
- name: Prepare Database
run: bash ./bin/e2e-after-setup.sh
- name: Run the tests
run: |
npm run test:unit:php
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

0 comments on commit 3603bdf

Please sign in to comment.