-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMSP-676] WP Redis PHP 8.3 compatibility checks (#446)
* add wpunit-helpers * bump php version for linting to 8.3 and add php execution check * add php8 compat checker * add test first pass still need to enable redis * bump composer.lock * add and use redis tests * update the phpcs:ignore line * maybe start redis? * setup and test redis * test with redis disabled * check if the database exists before running redis-enabled tests * fine.. * remove phpunit tests from circle * add some linebreaks between the phpunit runs * add -e to echoes * add emoji for the tests so they're easier to see and because I'm a dork * remove scripts sourced from wpunit-helpers from source control * add a matrix for redis enabled true/false * use a single script and export the WP_REDIS_USE_CACHE_GROUPS var for redis tests * we don't need the redis test now * we don't need the line breaks anymore
- Loading branch information
1 parent
d8eb080
commit 9b4bb9c
Showing
7 changed files
with
223 additions
and
392 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.0' | ||
php-version: 8.3 | ||
- name: Install dependencies | ||
run: composer install -n --prefer-dist | ||
- name: Run PHP Lint | ||
|
@@ -39,3 +39,62 @@ jobs: | |
uses: pantheon-systems/[email protected] | ||
with: | ||
type: plugin | ||
php8-compatibility: | ||
name: PHP 8.x Compatibility | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: pantheon-systems/phpcompatibility-action@dev | ||
with: | ||
paths: ${{ github.workspace }}/*.php | ||
test-versions: 8.0- | ||
test: | ||
needs: lint | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php_version: [7.4, 8.2, 8.3] | ||
redis_enabled: [true, false] | ||
services: | ||
mariadb: | ||
image: mariadb:${{ (matrix.php_version == '7.4') && '10.5' || '10.6' }} | ||
redis: | ||
image: redis:6.2 | ||
ports: | ||
- 6379:6379 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php_version }} | ||
extensions: mysqli, zip, imagick, redis | ||
- name: Start MySQL Service | ||
run: sudo systemctl start mysql | ||
- name: Test Redis | ||
run: | | ||
sudo apt-get install -y redis-tools | ||
redis-cli -h localhost ping | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/vendor | ||
key: test-dependencies-{{ checksum "composer.json" }} | ||
restore-keys: test-dependencies-{{ checksum "composer.json" }} | ||
- name: Install dependencies | ||
run: | | ||
if [ ${{ matrix.php_version }} = "7.4" ]; then | ||
composer update | ||
fi | ||
composer install | ||
- name: Run PHPUnit | ||
run: | | ||
if [ ${{ matrix.redis_enabled }} = 'true' ]; then | ||
export WP_REDIS_USE_CACHE_GROUPS=1 | ||
echo -e "🔋 Testing with Redis enabled" | ||
else | ||
echo -e "🪫 Testing with Redis disabled" | ||
fi | ||
bash ./bin/phpunit-test.sh |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.