Skip to content

chore: update wpgraphql-cs to 2.0-beta and lint #397

chore: update wpgraphql-cs to 2.0-beta and lint

chore: update wpgraphql-cs to 2.0-beta and lint #397

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 ]
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.repository == github.event.repository.full_name || github.event_name == 'push'
strategy:
matrix:
php: [ '8.0', '7.4' ]
wordpress: [ '6.3', '6.2', '6.1', '6.0', '5.9', '5.8', '5.7' ]
include:
- php: '8.1'
wordpress: '6.3'
coverage: 1
- php: '8.1'
wordpress: '6.2'
exclude:
- php: '7.4'
wordpress: '6.3'
- php: '7.4'
wordpress: '6.2'
fail-fast: false
steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request_target' }}
uses: styfle/[email protected]
- name: Checkout
uses: actions/checkout@v3
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@v2
- name: Build "testing" Docker Image
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .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 }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .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 }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .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 }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .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
- name: Push CodeCoverage to CodeClimate
if: ${{ matrix.coverage == 1 }}
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: c8f992fb9d2400821643b093de584af5a3c8d0a8f1f6f4e000592ccf0270ee29
with:
coverageLocations: |
${{github.workspace}}/tests/_output/*.xml:clover