Skip to content

Lint & Test

Lint & Test #146

Workflow file for this run

name: Lint & Test
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- '**'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHP Lint
run: composer phpcs
wporg-validation:
name: WP.org Plugin Validation
runs-on: ubuntu-latest
steps:
- uses: pantheon-systems/[email protected]
with:
type: 'plugin'
validate-readme-spacing:
name: Validate README Spacing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pantheon-systems/validate-readme-spacing@v1
php8-compatibility:
name: PHP 8.x Compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PHP Compatibility
uses: pantheon-systems/phpcompatibility-action@dev
with:
test-versions: 8.0-
paths: ${{ github.workspace }}/*.php ${{ github.workspace }}/inc/*.php
test-phpunit-74:
needs: lint
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.5
name: PHP 7.4 Unit Tests
steps:
- uses: actions/checkout@v3
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mysqli, zip, imagick
- name: Start MySQL Service
run: sudo systemctl start mysql
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
restore-keys: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
- name: Install Composer dependencies
run: |
composer update && composer install
- name: Run PHP linting
run: composer phplint
- name: Run PHPUnit
run: bash ./bin/phpunit-test.sh
test-phpunit-83:
needs: lint
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.6
name: PHP 8.3 Unit Tests
steps:
- uses: actions/checkout@v3
- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mysqli, zip, imagick
- name: Start MySQL Service
run: sudo systemctl start mysql
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
restore-keys: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
- name: Install Composer dependencies
run: composer install
- name: Run PHP linting
run: composer phplint
- name: Run PHPUnit
run: bash ./bin/phpunit-test.sh