Build(deps-dev): Bump phpunit/phpunit from 9.6.11 to 10.4.2 #4232
Workflow file for this run
This file contains 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: "CI" | |
on: | |
push: | |
branches: "*" | |
pull_request: | |
env: | |
php-version: 8.1 | |
cache-version: 1 | |
jobs: | |
platform-check: | |
name: "PHP 5.6 compatibility" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup PHP" | |
uses: shivammathur/setup-php@2.26.0 | |
with: | |
php-version: 5.6 | |
coverage: none | |
- name: "Check dependency compatibility" | |
run: | | |
composer check-platform-reqs --no-dev | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup PHP" | |
uses: shivammathur/setup-php@2.26.0 | |
with: | |
php-version: ${{ env.php-version }} | |
coverage: none | |
- name: "Setup Node" | |
uses: actions/setup-node@v4.0.0 | |
- name: "Cache Composer dependencies" | |
uses: actions/cache@v3 | |
with: | |
path: "~/.composer/cache" | |
key: composer-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('composer.json') }} | |
restore-keys: | | |
composer-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('composer.json') }} | |
composer-dependencies-${{ runner.os }}-${{ env.cache-version }}- | |
composer-dependencies-${{ runner.os }}- | |
- name: "Install Composer dependencies" | |
run: | | |
composer -n install | |
- name: "Cache NPM dependencies" | |
uses: actions/cache@v3 | |
with: | |
path: "~/.npm" | |
key: npm-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
npm-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('package.json') }} | |
npm-dependencies-${{ runner.os }}-${{ env.cache-version }}- | |
npm-dependencies-${{ runner.os }}- | |
- name: "Install NPM dependencies" | |
run: | | |
npm ci | |
- name: "Build" | |
run: | | |
npm run build | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "build-artifact" | |
path: dist | |
lint: | |
name: "Lint" | |
runs-on: ubuntu-latest | |
needs: build | |
env: | |
php-extensions: ast | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup PHP extension caching" | |
id: extcache | |
uses: shivammathur/cache-extensions@1.10.0 | |
with: | |
php-version: ${{ env.php-version }} | |
extensions: ${{ env.php-extensions }} | |
key: php-extensions-${{ runner.os }}-${{ env.cache-version }} | |
- name: "Cache extensions" | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.extcache.outputs.dir }} | |
key: ${{ steps.extcache.outputs.key }} | |
restore-keys: ${{ steps.extcache.outputs.key }} | |
- name: "Setup PHP" | |
uses: shivammathur/setup-php@2.26.0 | |
with: | |
php-version: ${{ env.php-version }} | |
extensions: ${{ env.php-extensions }} | |
coverage: none | |
- name: "Setup Node" | |
uses: actions/setup-node@v4.0.0 | |
- name: "Cache Composer dependencies" | |
uses: actions/cache@v3 | |
with: | |
path: "~/.composer/cache" | |
key: composer-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('composer.json') }} | |
restore-keys: | | |
composer-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('composer.json') }} | |
composer-dependencies-${{ runner.os }}-${{ env.cache-version }}- | |
composer-dependencies-${{ runner.os }}- | |
- name: "Install Composer dependencies" | |
run: | | |
composer -n install | |
- name: "Cache NPM dependencies" | |
uses: actions/cache@v3 | |
with: | |
path: "~/.npm" | |
key: npm-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
npm-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('package.json') }} | |
npm-dependencies-${{ runner.os }}-${{ env.cache-version }}- | |
npm-dependencies-${{ runner.os }}- | |
- name: "Install NPM dependencies" | |
run: | | |
npm ci | |
- name: "Download build artifact" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "build-artifact" | |
path: dist | |
- name: "Lint" | |
run: | | |
npm run lint | |
unit: | |
name: "Test" | |
runs-on: ubuntu-latest | |
needs: build | |
services: | |
mysql: | |
image: mysql:5 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup PHP" | |
uses: shivammathur/setup-php@2.26.0 | |
with: | |
php-version: ${{ env.php-version }} | |
coverage: pcov | |
- name: "Setup Node" | |
uses: actions/setup-node@v4.0.0 | |
- name: "Cache Composer dependencies" | |
uses: actions/cache@v3 | |
with: | |
path: "~/.composer/cache" | |
key: composer-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('composer.json') }} | |
restore-keys: | | |
composer-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('composer.json') }} | |
composer-dependencies-${{ runner.os }}-${{ env.cache-version }}- | |
composer-dependencies-${{ runner.os }}- | |
- name: "Install Composer dependencies" | |
run: | | |
composer -n install | |
- name: "Cache NPM dependencies" | |
uses: actions/cache@v3 | |
with: | |
path: "~/.npm" | |
key: npm-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
npm-dependencies-${{ runner.os }}-${{ env.cache-version }}-${{ hashFiles('package.json') }} | |
npm-dependencies-${{ runner.os }}-${{ env.cache-version }}- | |
npm-dependencies-${{ runner.os }}- | |
- name: "Install NPM dependencies" | |
run: | | |
npm ci | |
- name: "Download build artifact" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "build-artifact" | |
path: dist | |
- name: "Prepare WordPress test environment" | |
run: | | |
./bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest | |
- name: "Run tests" | |
run: | | |
npm run test | |
- name: "Upload coverage results" | |
uses: codecov/codecov-action@v3.1.4 |