chore(deps): Bump codecov/codecov-action (#6069) #7068
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 (WP Core) | |
on: | |
push: | |
branches: | |
- develop | |
- staging | |
- production | |
- gh-readonly-queue/** | |
pull_request: | |
branches: | |
- develop | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
env: | |
LOCAL_PHP: "8.2-fpm" | |
LOCAL_PHP_XDEBUG: "false" | |
LOCAL_PHP_XDEBUG_MODE: "develop,debug" | |
LOCAL_DB_TYPE: "mysql" | |
LOCAL_DB_VERSION: "8.3" | |
LOCAL_PHP_MEMCACHED: "true" | |
LOCAL_WP_TESTS_DOMAIN: "example.org" | |
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true" | |
jobs: | |
wp-core: | |
name: "Run WP Core Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the latest WP version | |
id: version | |
run: | | |
echo "latest=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r '.offers | map(select( .response == "upgrade")) | .[0].version')" >> $GITHUB_OUTPUT | |
- name: Configure environment variables | |
run: | | |
echo "PHP_FPM_UID=$(id -u)" >> "${GITHUB_ENV}" | |
echo "PHP_FPM_GID=$(id -g)" >> "${GITHUB_ENV}" | |
- name: Checkout WordPress | |
uses: actions/checkout@v4.2.2 | |
with: | |
repository: wordpress/wordpress-develop | |
path: wordpress | |
ref: ${{ steps.version.outputs.latest }} | |
- name: Check out source code | |
uses: actions/checkout@v4.2.2 | |
with: | |
submodules: recursive | |
path: wordpress/src/wp-content/mu-plugins | |
- name: Tweaks | |
run: | | |
echo "define( 'VIP_JETPACK_SKIP_LOAD', 'true' );" >> "wordpress/src/wp-content/mu-plugins/000-vip-init.php" | |
cp wordpress/.env.example wordpress/.env | |
echo "GITHUB_EVENT_NAME=pull_request" >> "wordpress/.env" | |
- name: Set up Node.js | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version-file: 'wordpress/.nvmrc' | |
cache: npm | |
cache-dependency-path: 'wordpress/package-lock.json' | |
- name: Set up PHP | |
uses: shivammathur/setup-php@2.30.5 | |
with: | |
php-version: 8.0 | |
coverage: none | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@3.0.0 | |
with: | |
working-directory: wordpress | |
- name: Install npm dependencies | |
run: npm ci | |
working-directory: wordpress | |
- name: Start Docker environment | |
run: npm run env:start | |
working-directory: wordpress | |
- name: Log running Docker containers | |
run: docker ps -a | |
- name: WordPress Docker container debug information | |
run: | | |
docker compose run --rm mysql mysql --version | |
docker compose run --rm php php --version | |
docker compose run --rm php php -m | |
docker compose run --rm php php -i | |
docker compose run --rm php locale -a | |
working-directory: wordpress | |
- name: Install WordPress | |
run: npm run env:install | |
working-directory: wordpress | |
- name: Run PHPUnit tests | |
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist | |
working-directory: wordpress | |
- name: Run AJAX tests | |
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group ajax | |
working-directory: wordpress | |
- name: Run ms-files tests as a multisite install | |
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files | |
working-directory: wordpress | |
- name: Run external HTTP tests | |
run: | | |
node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http | |
working-directory: wordpress |