Bugfix pre 0.7 #175
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests | |
on: pull_request | |
jobs: | |
test: | |
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }} | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
env: | |
WP_TESTS_DIR: /tmp/wordpress-tests-lib | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ '7.4', '8.2', 'latest' ] | |
wp: [ 'latest' ] | |
services: | |
database: | |
image: mysql:5.6 | |
env: | |
MYSQL_ROOT_PASSWORD: wordpress | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer | |
extensions: mysql | |
coverage: none | |
- name: Install SVN | |
run: sudo apt-get update && sudo apt-get install -y subversion | |
- name: update dependencies | |
run: composer update | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress | |
- name: Regenerate the autoloader files | |
run: composer dump-autoload --optimize | |
- name: Install WordPress and initialize database | |
run: chmod +x ./tests/bin/install-wp-tests.sh && ./tests/bin/install-wp-tests.sh cf7a_tests root wordpress 127.0.0.1 latest | |
- name: Run PHP Unit tests | |
run: composer run test | |
test-e2e: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
wp: [ '6.5', 'latest' ] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: composer | |
extensions: mysql | |
coverage: none | |
- name: Install SVN | |
run: sudo apt-get update && sudo apt-get install -y subversion | |
- name: update dependencies | |
run: composer update | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress | |
- name: Regenerate the autoloader files | |
run: composer dump-autoload --optimize | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install Playwright Browsers | |
run: | | |
sudo npx playwright install-deps chromium | |
npx playwright install | |
- name: Installing NPM dependencies | |
run: npm i | |
- name: Build | |
run: npm run build | |
- name: Starting the WordPress Environment | |
run: npm run wp-env:start | |
- name: Running e2e tests | |
run: npm run test:e2e | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: | | |
playwright-report/ | |
test-results/ | |
retention-days: 30 | |
- name: Upload screenshots on failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: e2e-screenshots-wp-${{ matrix.wp }} | |
path: | | |
tests/e2e/screenshots/ | |
debug-*.png | |
retention-days: 7 |