Skip to content

Use the testing dir for ABSPATH if not set #2699

Use the testing dir for ABSPATH if not set

Use the testing dir for ABSPATH if not set #2699

Workflow file for this run

name: "All Pull Request Tests"
on:
push:
branches:
- main
- '*.x'
- '*.*.x'
pull_request:
branches:
- main
- '*.x'
- '*.*.x'
jobs:
lint-tests:
if: github.event.pull_request.draft == false
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Lint Tests"
steps:
- uses: actions/checkout@v4
- name: Run General Tests
uses: alleyinteractive/action-test-general@develop
- name: Run Linter
uses: alleyinteractive/action-test-php@develop
with:
php-version: '8.4'
skip-services: 'true'
skip-wordpress-install: 'true'
test-command: 'composer lint'
unit-tests:
if: github.event.pull_request.draft == false
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
dependencies: ["prefer-lowest", "prefer-stable"]
multisite: [true, false]
php: [8.2, 8.3, 8.4]
wordpress: ["latest"]
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}-MS${{ matrix.multisite && '1' || '0' }}-D${{ matrix.dependencies }}
cancel-in-progress: true
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }} ${{ matrix.multisite && 'Multisite' || '' }} Dependencies ${{ matrix.dependencies }}"
steps:
- uses: actions/checkout@v4
- name: Run PHP Tests
uses: alleyinteractive/action-test-php@develop
with:
install-command: composer update --${{ matrix.dependencies }} --prefer-dist --no-interaction --no-progress
php-version: '${{ matrix.php }}'
skip-wordpress-install: 'true'
test-command: 'composer phpunit'
wordpress-host: 'false'
wordpress-multisite: '${{ matrix.multisite }}'
wordpress-version: '${{ matrix.wordpress }}'
# This required job ensures that all PR checks have passed before merging.
all-pr-checks-passed:
name: All PR checks passed
needs:
- lint-tests
- unit-tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Check job statuses
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more jobs failed"
exit 1
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs were cancelled"
exit 1
else
echo "All jobs passed or were skipped"
exit 0
fi