Skip to content

Return RFC 6749 error fields from the token endpoint #48

Return RFC 6749 error fields from the token endpoint

Return RFC 6749 error fields from the token endpoint #48

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
schedule:
# Weekly, so new WordPress releases and trunk get exercised even when the repo is quiet.
- cron: '0 6 * * 1'
workflow_dispatch:
jobs:
wp-versions:
name: Resolve WordPress versions
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.resolve.outputs.branches }}
steps:
- name: Fetch supported branches from wordpress.org
id: resolve
run: |
# stable-check lists every x.y.z release. Reduce to x.y branches and keep the newest five,
# so the matrix picks up new majors automatically and drops old ones. Trunk rides along
# as "nightly" so the next release is tested before it ships.
branches=$(curl -sf https://api.wordpress.org/core/stable-check/1.0/ | python3 -c '
import json, sys
versions = json.load(sys.stdin)
branches = {".".join(v.split(".")[:2]) for v in versions}
branches = sorted(branches, key=lambda b: tuple(int(n) for n in b.split(".")))
print(json.dumps(branches[-5:] + ["nightly"]))
')
echo "Testing against WordPress: $branches"
echo "branches=$branches" >> "$GITHUB_OUTPUT"
phpunit:
name: PHP ${{ matrix.php }} / WP ${{ matrix.wp }}
runs-on: ubuntu-latest
needs: wp-versions
# Trunk is allowed to fail without failing the run.
continue-on-error: ${{ matrix.wp == 'nightly' }}
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
wp: ${{ fromJSON(needs.wp-versions.outputs.branches) }}
steps:
- uses: actions/checkout@v7
- name: Install SVN
run: sudo apt-get update -q && sudo apt-get install -y subversion
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: none
- name: Cache Composer packages
uses: actions/cache@v6
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Install WordPress test suite
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:3306 ${{ matrix.wp }} true
- name: Run PHPUnit
run: vendor/bin/phpunit
- name: Run PHPUnit (multisite)
run: WP_MULTISITE=1 vendor/bin/phpunit
phpcs:
name: PHPCS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
coverage: none
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Run PHPCS
run: vendor/bin/phpcs