Skip to content

chore(deps): update wordpress:apache docker digest to 13bb405 #1559

chore(deps): update wordpress:apache docker digest to 13bb405

chore(deps): update wordpress:apache docker digest to 13bb405 #1559

Workflow file for this run

name: CI
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
unit-tests:
name: "WP ${{ matrix.config.wp }}, multisite: ${{ matrix.config.ms }}, PHP: ${{ matrix.config.php }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- { wp: latest, ms: 'no', php: '7.4', phpunit: 7 }
- { wp: nightly, ms: 'no', php: '7.4', phpunit: 7 }
- { wp: latest, ms: 'yes', php: '7.4', phpunit: 7 }
- { wp: nightly, ms: 'yes', php: '7.4', phpunit: 7 }
- { wp: latest, ms: 'no', php: '8.0', phpunit: 9 }
- { wp: latest, ms: 'yes', php: '8.0', phpunit: 9 }
- { wp: nightly, ms: 'no', php: '8.0', phpunit: 9 }
- { wp: nightly, ms: 'yes', php: '8.0', phpunit: 9 }
- { wp: latest, ms: 'no', php: '8.1', phpunit: 9, coverage: 'yes' }
- { wp: latest, ms: 'yes', php: '8.1', phpunit: 9, coverage: 'yes' }
- { wp: nightly, ms: 'no', php: '8.1', phpunit: 9 }
- { wp: nightly, ms: 'yes', php: '8.1', phpunit: 9 }
- { wp: latest, ms: 'no', php: '8.2', phpunit: 9 }
- { wp: latest, ms: 'yes', php: '8.2', phpunit: 9 }
- { wp: nightly, ms: 'no', php: '8.2', phpunit: 9 }
- { wp: nightly, ms: 'yes', php: '8.2', phpunit: 9 }
- { wp: latest, ms: 'no', php: '8.3', phpunit: 9 }
- { wp: latest, ms: 'yes', php: '8.3', phpunit: 9 }
- { wp: nightly, ms: 'no', php: '8.3', phpunit: 9 }
- { wp: nightly, ms: 'yes', php: '8.3', phpunit: 9 }
services:
mysql:
image: mariadb:latest
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: wordpress
MARIADB_INITDB_SKIP_TZINFO: 1
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_DATABASE: wordpress_test
steps:
- name: Check out source code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Decide whether to enable coverage
id: coverage
run: |
if [ "${{ matrix.config.coverage }}" = "yes" ]; then
echo "::set-output name=coverage::pcov"
echo '::set-output name=ini::pcov.directory=inc, pcov.exclude="~/(vendor|tests|node_modules)/~"'
else
echo "::set-output name=coverage::none"
echo "::set-output name=ini::opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M"
fi
- name: Set up PHP
uses: shivammathur/setup-php@efffd0e4f2504f936fcfe3b69293d31ce0e2fd7a # 2.30.3
with:
coverage: ${{ steps.coverage.outputs.coverage }}
ini-values: ${{ steps.coverage.outputs.ini }}
php-version: ${{ matrix.config.php }}
env:
fail-fast: 'true'
- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0
- name: Set up WordPress and WordPress Test Library
uses: sjinks/setup-wordpress-test-library@badbd264eafbfd40b3d1c280b08c83ff1b500334 # 2.0.2
with:
version: ${{ matrix.config.wp }}
- name: Set up multisite mode
run: echo "WP_MULTISITE=1" >> $GITHUB_ENV
if: matrix.config.ms == 'yes'
- name: Update wp-test-config.php
run: |
if php -r 'exit(PHP_VERSION_ID < 80100);'; then
echo "Disabling WP_DEBUG in wp-test-config.php"
sed -i "s@define( 'WP_DEBUG', true );@// define( 'WP_DEBUG', true );@" /tmp/wordpress-tests-lib/wp-tests-config.php
fi
- name: Verify MariaDB connection
run: |
while ! mysqladmin ping -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} --silent; do
sleep 1
done
timeout-minutes: 1
- name: Run tests
run: |
OPTIONS=
if [ "${{ steps.coverage.outputs.coverage }}" != 'none' ]; then
OPTIONS="$OPTIONS --coverage-clover=clover.xml"
fi
vendor/bin/phpunit --order-by=random ${OPTIONS}
- name: Upload coverage report
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
with:
files: clover.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ steps.coverage.outputs.coverage != 'none' }}
build:
name: Build JS Files
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Set up Node.js environment
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run postinstall scripts
run: npm rebuild && npm run prepare --if-present
- name: Build JS files
run: npm run build