chore(deps-dev): bump the dev-dependencies group with 9 updates (#737) #1272
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
prepare: | |
name: Prepare | |
uses: projek-xyz/actions/.github/workflows/configure.yml@main | |
with: | |
php-version: 8.0 | |
permissions: | |
pull-requests: write | |
contents: read | |
run: | |
name: on WordPress ${{ matrix.wp }} | |
runs-on: ubuntu-latest | |
needs: [prepare] | |
env: | |
DB_USER: ${{ github.repository_owner }} | |
DB_PASS: secret | |
DB_NAME: wordpress | |
DB_HOST: mysql | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASS }} | |
MYSQL_DATABASE: ${{ env.DB_NAME }} | |
MYSQL_USER: ${{ env.DB_USER }} | |
MYSQL_PASSWORD: ${{ env.DB_PASS }} | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
ports: | |
- 3306:3306 | |
strategy: | |
matrix: | |
php: [8.0] | |
wp: [5.x, 6.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: xdebug | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.prepare.outputs.composer-cache }} | |
key: ${{ needs.prepare.outputs.composer-cache-key }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ needs.prepare.outputs.composer-cache-key }}-composer- | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: | | |
composer require "roots/wordpress=${{ matrix.wp }}" --no-update | |
composer update --prefer-dist --no-interaction --no-progress | |
- name: Install WordPress Core | |
env: | |
WP_ENV: testing | |
WP_HOME: http://localhost:8080 | |
DB_HOST: 127.0.0.1:${{ job.services.mysql.ports['3306'] }} | |
run: .github/setup.sh | |
- name: Unit Test | |
run: | | |
vendor/bin/phpcs --standard=packages/phpcs.xml packages | |
vendor/bin/phpunit -c tests/phpunit.xml --coverage-text | |
# - name: End-to-end Tests | |
# if: matrix.wp == 5.4 | |
# env: | |
# BROWSERSTACK_PROJECT: "${{ github.repository }} - ${{ github.workflow }}" | |
# BROWSERSTACK_BUILD: ${{ github.ref }} | |
# BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }} | |
# BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
# run: | | |
# yarn gulp build --mode production | |
# yarn gulp e2e --mode testing |