Skip to content

Replace all calls to get_post_meta #1558

Replace all calls to get_post_meta

Replace all calls to get_post_meta #1558

Workflow file for this run

name: PHP linting and tests
on:
pull_request
env:
WP_VERSION: latest
WC_VERSION: latest # the min supported version as per L-2 policy
jobs:
phpcs:
name: PHP Code Sniffer
runs-on: ubuntu-latest
steps:
# clone the repository
- uses: actions/checkout@v2
with:
fetch-depth: 0
# enable dependencies caching
- uses: actions/cache@v2
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.3' # needs >=7.3 for SARB
tools: composer
coverage: none
# install dependencies and run phpcs
- run: composer self-update 2.0.6 && composer install --no-progress && composer phpcs
lint:
name: PHP Linting
runs-on: ubuntu-latest
steps:
# clone the repository
- uses: actions/checkout@v2
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
coverage: none
# run CI checks
- run: find . \( -path ./vendor \) -prune -o \( -name '*.php' \) -exec php -lf {} \;| (! grep -v "No syntax errors detected" )
test:
name: PHP testing
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix:
php: [ '7.4', '8.0', '8.1', '8.2' ]
steps:
# clone the repository
- uses: actions/checkout@v2
# enable dependencies caching
- uses: actions/cache@v2
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
# run CI checks
- run: |
echo "bash bin/run-ci-tests.sh"
bash bin/run-ci-tests.sh
compatibility-oldest:
name: Run unit tests on Oldest supported version
runs-on: ubuntu-latest
env:
WC_VERSION: 7.7.0 # the min supported version as per L-2 policy
WP_VERSION: 'latest'
steps:
# clone the repository
- uses: actions/checkout@v2
# enable dependencies caching
- uses: actions/cache@v2
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer
# run CI checks
- run: bash bin/run-ci-tests.sh
compatibility-beta:
name: Run unit tests on beta WC
runs-on: ubuntu-latest
env:
WC_VERSION: 'beta'
WP_VERSION: 'latest'
steps:
# clone the repository
- uses: actions/checkout@v2
# enable dependencies caching
- uses: actions/cache@v2
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
# run CI checks
- run: bash bin/run-ci-tests.sh