Skip to content

feat!: refactor to AutoRegister facets to schema. #151

feat!: refactor to AutoRegister facets to schema.

feat!: refactor to AutoRegister facets to schema. #151

name: Integration Testing
on:
push:
branches:
- develop
- main
pull_request_target:
branches:
- develop
- main
paths:
- "**.php"
- ".github/workflows/*.yml"
- "!docs/**"
types: [ opened, synchronize, reopened, labeled ]
# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name, along with the head branch ref of the pull request
# or otherwise the branch or tag ref.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
continuous_integration:
runs-on: ubuntu-latest
name: WordPress ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
if: contains(github.event.pull_request.labels.*.name, 'safe to test ✔') || ( github.event_name == 'push' && ( github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' ) )
strategy:
matrix:
php: ["8.2", "8.1", "8.0"]
wordpress: ["6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.9" ]
include:
- php: "8.2"
wordpress: "6.5"
coverage: 1
# Test old versions against PHP 8.0
- php: "7.4"
wordpress: "6.1"
- php: "7.4"
wordpress: "6.0"
- php: "7.4"
wordpress: "5.9"
exclude:
# Old WP versions that dont support newer PHP versions
- php: "8.2"
wordpress: "6.0"
- php: "8.2"
wordpress: "5.9"
- php: "8.1"
wordpress: "5.9"
# New WP versions that dont support older PHP versions
- php: "8.0"
wordpress: "6.5"
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring
tools: composer:v2
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Build "testing" Docker Image
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
cp .env.dist .env
echo GIT_TOKEN=${{ secrets.GIT_TOKEN }} >> .env
composer build-test
- name: Run Acceptance Tests w/ Docker
env:
COVERAGE: ${{ matrix.coverage }}
USING_XDEBUG: ${{ matrix.coverage }}
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
SUITES: acceptance
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
cp .env.dist .env
echo GIT_TOKEN=${{ secrets.GIT_TOKEN }} >> .env
composer run-test
# - name: Run Unit Tests w/ Docker
# env:
# COVERAGE: ${{ matrix.coverage }}
# USING_XDEBUG: ${{ matrix.coverage }}
# DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
# SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
# SUITES: unit
# PHP_VERSION: ${{ matrix.php }}
# WP_VERSION: ${{ matrix.wordpress }}
# GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
# run: |
# cp .env.dist .env
# echo GIT_TOKEN=${{ secrets.GIT_TOKEN }} >> .env
# composer run-test
- name: Run WPUnit Tests w/ Docker
env:
COVERAGE: ${{ matrix.coverage }}
USING_XDEBUG: ${{ matrix.coverage }}
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
cp .env.dist .env
echo GIT_TOKEN=${{ secrets.GIT_TOKEN }} >> .env
composer run-test
- name: Push Codecoverage to Coveralls.io
if: ${{ matrix.coverage == 1 }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: vendor/bin/php-coveralls -v