Merge branch 'feature/freemius-2.9.0' into develop #34
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: Unit Testing | |
on: | |
push: | |
branches: [ "develop", "feature/*", "release/*" ] | |
pull_request: | |
branches: [ "develop" ] | |
permissions: | |
contents: read | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mariadb:10.5 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 | |
strategy: | |
matrix: | |
php-versions: ['7.2', '7.3', '7.4', '8.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: none | |
tools: composer, phpunit-polyfills | |
extensions: mysql | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
- name: Install Composer dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Install WordPress testing tools | |
run: bash tools/install-wp-tests.sh wordpress_test root root 127.0.0.1 latest | |
- name: Run test suite | |
run: composer run-script test | |
env: | |
PHP_VERSION: ${{ matrix.php-versions }} |