You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.3 KiB
YAML

name: Static Code Analysis
on:
pull_request:
push:
branches:
- dev
- main
- 'release/**'
- 'feature/**'
- 'fix/**'
env:
PHP_VERSION: 7.4
WP_MODE: 'single'
WP_MULTISITE: 0
WP_VERSION: '5.7.*'
jobs:
check:
name: Setup & Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup PHP Environment
uses: shivammathur/setup-php@v2
# https://github.com/marketplace/actions/setup-php-action
with:
php-version: ${{ env.PHP_VERSION }}
tools: composer:v2
- name: Cache Composer dependencies
uses: actions/cache@v2
env:
composer-cache-name: cache-vendor
with:
path: ~/vendor
key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.composer-cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Require Specified WordPress Version
run: composer require johnpbloch/wordpress-core:${{ env.WP_VERSION }} --dev --prefer-source --update-with-all-dependencies
- name: Install Composer Dependencies
run: composer install
- name: Perform Static Analysis
run: composer run-script analyze