Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
groups:
github-actions:
patterns:
- "*"
66 changes: 38 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ name: Unit/Integration Tests

on:
pull_request:
branches:
- trunk
- develop
workflow_dispatch:

# Cancel all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
run:
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 30

strategy:
fail-fast: false
Expand All @@ -19,44 +26,47 @@ jobs:

name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.

env:
WP_TESTS_DIR: "/tmp/tests/phpunit"
WP_CORE_DIR: "/tmp/wordpress-develop"
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Setup PHP + Composer
uses: wp-media/workflows/.github/actions/setup-php-composer@main
with:
php-version: ${{ matrix.php-versions }}
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: none

- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Setup WordPress test suite
uses: wp-media/workflows/.github/actions/setup-wp-tests@main
with:
wp-version: ${{ matrix.wp-versions }}

# Registered here, not in the composite action: GitHub removes problem
# matchers added inside a composite action when it finishes, so they must
# be added in the caller to stay active for the test steps below.
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Composer dependencies
uses: ramsey/composer-install@v4
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install SVN
run: sudo apt-get install subversion

- name: Install tests
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp-versions }}
- name: Unit tests
run: composer test-unit

- name: Mysql8 auth plugin workaround
run: sudo mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
- name: Integration tests
run: composer test-integration

- name: Test
run: composer run-tests
- name: Admin integration tests
run: composer test-integration-admin
66 changes: 38 additions & 28 deletions .github/workflows/tests_legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ name: Unit/Integration Tests - Legacy

on:
pull_request:
branches:
- trunk
- develop
workflow_dispatch:

# Cancel all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
run:
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 30

strategy:
fail-fast: false
Expand All @@ -19,44 +26,47 @@ jobs:

name: WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.

env:
WP_TESTS_DIR: "/tmp/tests/phpunit"
WP_CORE_DIR: "/tmp/wordpress-develop"
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Setup PHP + Composer
uses: wp-media/workflows/.github/actions/setup-php-composer@main
with:
php-version: ${{ matrix.php-versions }}
coverage: none # XDebug can be enabled here 'coverage: xdebug'
tools: none

- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Setup WordPress test suite
uses: wp-media/workflows/.github/actions/setup-wp-tests@main
with:
wp-version: ${{ matrix.wp-versions }}

# Registered here, not in the composite action: GitHub removes problem
# matchers added inside a composite action when it finishes, so they must
# be added in the caller to stay active for the test steps below.
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Composer dependencies
uses: ramsey/composer-install@v4
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install SVN
run: sudo apt-get install subversion

- name: Install tests
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp-versions }}
- name: Unit tests
run: composer test-unit

- name: Mysql8 auth plugin workaround
run: sudo mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
- name: Integration tests
run: composer test-integration

- name: Test
run: composer run-tests
- name: Admin integration tests
run: composer test-integration-admin
152 changes: 0 additions & 152 deletions bin/install-wp-tests.sh

This file was deleted.

Loading