Skip to content

Keep current status for a question when it is updated #4892

Keep current status for a question when it is updated

Keep current status for a question when it is updated #4892

Workflow file for this run

name: PHP & JavaScript Code Coverage
on: pull_request
jobs:
coverage:
name: PHP and JS Test Coverage
runs-on: ubuntu-latest
continue-on-error: false
env:
WP_VERSION: latest
WP_MULTISITE: 0
PHP_VERSION: 7.4
services:
database:
image: mysql:5.6
env:
MYSQL_ROOT_PASSWORD: root
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: Get cached composer directories
uses: actions/cache@v3
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-vendor-${{ hashFiles('composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mysql
tools: composer
coverage: xdebug
- name: Tool versions
run: |
php --version
composer --version
- name: Install PHP dependencies
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress --ignore-platform-reqs
- name: Setup test environment
run: bash ./tests/bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 $WP_VERSION
- name: Run tests with coverage
run: php -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover ./coverage.xml
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install JS dependencies
run: npm ci
- name: Test JS
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run test-js:coverage
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3