Compare commits

...

31 commits

Author SHA1 Message Date
2809d35daf cleanup repo
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 33s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 59s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 51s
2024-09-21 14:12:56 +02:00
3e5ee2d045 test
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 37s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m0s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 54s
2024-09-21 14:01:49 +02:00
b4e6fef665 test
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 1m15s
Unit Testing / PHPUnit – PHP 8.1 (pull_request) Successful in 1m47s
Unit Testing / PHPUnit – PHP 8.2 (pull_request) Failing after 1m24s
Unit Testing / PHPUnit – PHP 8.3 (pull_request) Failing after 1m5s
2024-09-21 13:44:44 +02:00
943dcd8cb5 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 51s
Unit Testing / PHPUnit – PHP 8.2 (pull_request) Failing after 6m18s
Unit Testing / PHPUnit – PHP 8.1 (pull_request) Successful in 6m24s
Unit Testing / PHPUnit – PHP 8.3 (pull_request) Failing after 6m5s
2024-09-21 13:42:19 +02:00
e0b66de594 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Has been cancelled
Unit Testing / Run PHPUnit 8.1 (pull_request) Has been cancelled
Unit Testing / Run PHPUnit 8.2 (pull_request) Has been cancelled
Unit Testing / Run PHPUnit 8.3 (pull_request) Has been cancelled
2024-09-21 13:41:17 +02:00
9a4351dc70 better naming of jobs
Some checks failed
Unit Testing / Run PHPunit (pull_request) Has been cancelled
PHP Code Checker / Run PHP Code Checker (pull_request) Has been cancelled
2024-09-21 13:37:49 +02:00
e18493897f add unittests for php 8.1 - 8.3
Some checks are pending
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 37s
Unit Testing / Run phpunit tests (pull_request) Has started running
2024-09-21 13:35:45 +02:00
0329ed8f19 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 32s
Unit Testing / Run phpunit tests (pull_request) Successful in 4m22s
2024-09-21 13:32:32 +02:00
80a5e13fba test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 33s
Unit Testing / Run phpunit tests (pull_request) Failing after 35s
2024-09-21 13:30:10 +02:00
47f026b4b4 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 36s
Unit Testing / Run phpunit tests (pull_request) Failing after 3s
2024-09-21 13:28:49 +02:00
4d32178120 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 1m15s
Unit Testing / Run phpunit tests (pull_request) Failing after 5s
2024-09-21 13:28:08 +02:00
7204bccb03 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Failing after 32s
Unit Testing / Run phpunit tests (pull_request) Failing after 3s
2024-09-21 13:26:35 +02:00
bd037022bc use different caches for composer
Some checks failed
Unit Testing / Run phpunit tests (pull_request) Has been cancelled
PHP Code Checker / Run PHP Code Checker (pull_request) Has been cancelled
2024-09-21 13:26:24 +02:00
380495e1b6 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 1m40s
Unit Testing / Run phpunit tests (pull_request) Successful in 1m2s
2024-09-21 13:15:52 +02:00
6c71423d62 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 1m3s
Unit Testing / Run phpunit tests (pull_request) Successful in 1m8s
2024-09-21 13:13:50 +02:00
1008bd62c8 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 1m9s
Unit Testing / Run phpunit tests (pull_request) Successful in 1m13s
2024-09-21 13:11:43 +02:00
50c25cdc4e test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 40s
Unit Testing / Run phpunit tests (pull_request) Failing after 2m27s
2024-09-21 13:00:08 +02:00
c2fb6dffde test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Has been cancelled
Unit Testing / Run phpunit tests (pull_request) Successful in 2m50s
2024-09-21 12:55:55 +02:00
e3041b015f test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 33s
Unit Testing / Run phpunit tests (pull_request) Failing after 1m1s
2024-09-21 12:53:02 +02:00
535e77c017 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 34s
Unit Testing / Run phpunit tests (pull_request) Failing after 1m1s
2024-09-21 12:47:15 +02:00
6020c1f277 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 39s
Unit Testing / Run phpunit tests (pull_request) Failing after 1m5s
2024-09-21 12:45:07 +02:00
f8d0f01be0 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 37s
Unit Testing / Run phpunit tests (pull_request) Failing after 4m27s
2024-09-21 12:41:36 +02:00
5b7676ee09 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 45s
Unit Testing / Run phpunit tests (pull_request) Has been cancelled
2024-09-21 12:38:14 +02:00
2af7ea5288 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 44s
Unit Testing / Run phpunit tests (pull_request) Successful in 3m57s
2024-09-21 12:30:23 +02:00
8b343eb46e test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Failing after 34s
Unit Testing / Run phpunit tests (pull_request) Successful in 3m56s
2024-09-21 12:22:44 +02:00
6a89c00e2d violate a coding standard
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Failing after 34s
Unit Testing / Run phpunit tests (pull_request) Successful in 3m57s
2024-09-21 12:15:29 +02:00
7bb31e1a71 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 36s
Unit Testing / Run phpunit tests (pull_request) Successful in 3m55s
2024-09-21 12:14:14 +02:00
7ce208d7b8 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 32s
Unit Testing / Run phpunit tests (pull_request) Successful in 3m59s
2024-09-21 12:13:22 +02:00
a1e847d465 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 43s
Unit Testing / Run phpunit tests (pull_request) Failing after 1s
2024-09-21 12:11:04 +02:00
d520ed5939 test
Some checks failed
PHP Code Checker / Run PHP Code Checker (pull_request) Failing after 2s
Unit Testing / Run phpunit tests (pull_request) Failing after 1s
2024-09-21 12:10:31 +02:00
f0903de277 test
All checks were successful
PHP Code Checker / Run PHP Code Checker (pull_request) Successful in 41s
Unit Testing / Run phpunit tests (pull_request) Successful in 3m56s
2024-09-21 12:03:56 +02:00
5 changed files with 77 additions and 20 deletions

View file

@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1']
name: Run PHP Code Checker
name: PHP Code Checker
env:
extensions: mysql
key: cache-v1
@ -25,16 +25,25 @@ jobs:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
- name: Cache Composer
id: cache-composer
uses: https://code.forgejo.org/actions/cache@v4
with:
path: |
./vendor/
key: cache-composer-phpcs-1
- name: Setup PHP
uses: https://github.com/shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: composer, cs2pr
tools: composer
env:
runner: self-hosted
- name: Install Composer dependencies for PHP
if: steps.cache-composer.outputs.cache-hit != 'true'
uses: ramsey/composer-install@v3
- name: Detect coding standard violations

View file

@ -1,4 +1,5 @@
name: Unit Testing
name: PHPUnit
on:
push:
branches:
@ -19,8 +20,8 @@ jobs:
MYSQL_ROOT_PASSWORD: root
strategy:
matrix:
php-versions: ['8.1']
name: Run phpunit tests
php-version: ['8.1', '8.2', '8.3']
name: PHPUnit PHP ${{ matrix.php-version }}
env:
extensions: mysql
key: cache-v1
@ -28,25 +29,51 @@ jobs:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
- name: Cache WordPress Setup
id: cache-wordpress
uses: https://code.forgejo.org/actions/cache@v4
with:
path: |
${{ env.WP_CORE_DIR }}
${{ env.WP_TESTS_DIR }}
key: cache-wordpress-1
- name: Cache Composer
id: cache-composer-phpunit
uses: https://code.forgejo.org/actions/cache@v4
with:
path: |
./vendor/
key: cache-composer-phpunit-1
- name: Setup PHP
uses: https://github.com/shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer, phpunit-polyfills
tools: composer
env:
runner: self-hosted
- name: Install Composer dependencies for PHP
uses: ramsey/composer-install@v3
- name: Install PHPUnit and PHPUnit-Polyfills
if: steps.cache-composer-phpunit.outputs.cache-hit != 'true'
run: composer require --dev yoast/phpunit-polyfills:"^3.0"
- name: Install mysqladmin
run: sudo apt update && sudo apt -y upgrade && sudo apt -y install mysql-client
- name: Install and cache mysqladmin needed to initialize the test database
uses: https://github.com/awalsh128/cache-apt-pkgs-action@latest
with:
packages: mysql-client
version: 1.0
- name: Setup Test Environment
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 6.6
if: steps.cache-wordpress.outputs.cache-hit != 'true'
run: bash tests/install-wp-tests.sh wordpress_test root root 127.0.0.1 6.6 false false false false
- name: Initialize WordPress test database
if: steps.cache-wordpress.outputs.cache-hit != 'false'
run: bash tests/install-wp-tests.sh wordpress_test root root 127.0.0.1 6.6 false true true true
- name: Unit Testing
run: cd /workspace/Event-Federation/wordpress-activitypub-event-extensions/ && phpunit
run: cd /workspace/Event-Federation/wordpress-activitypub-event-extensions/ && ./vendor/bin/phpunit
env:
PHP_VERSION: ${{ matrix.php-versions }}
PHP_VERSION: ${{ matrix.php-version }}

View file

@ -10,7 +10,7 @@
"phpcompatibility/php-compatibility": "*",
"phpcompatibility/phpcompatibility-wp": "*",
"squizlabs/php_codesniffer": "3.*",
"wp-coding-standards/wpcs": "dev-develop",
"wp-coding-standards/wpcs": "^3.1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"sirbrillig/phpcs-variable-analysis": "^2.11"
},
@ -32,10 +32,15 @@
},
"scripts": {
"lint": [
"vendor/bin/phpcs -n -q"
"vendor/bin/phpcs"
],
"lint:fix": [
"vendor/bin/phpcbf"
],
"test": [
"composer install",
"tests/install-wp-tests.sh activitypub-test root activitypub-test test-db latest true",
"vendor/bin/phpunit"
]
}
}

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation] [skip-wp-install] [skip-plugins] [skip-test-suite]"
exit 1
fi
@ -11,6 +11,10 @@ DB_PASS=$3
DB_HOST=${4-localhost}
WP_VERSION=${5-latest}
SKIP_DB_CREATE=${6-false}
SKIP_WP_INSTALL=${7-false}
SKIP_PLUGINS_INSTALL=${8-false}
SKIP_TEST_SUITE_INSTALL=${9-false}
TMPDIR=${TMPDIR-/tmp}
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
@ -54,7 +58,10 @@ fi
set -ex
install_wp() {
rm -rf $WP_CORE_DIR
if [ "$SKIP_WP_INSTALL" = "true" ]; then
echo "Skipping WordPress installation."
return 0
fi
if [ -d $WP_CORE_DIR ]; then
return;
@ -97,6 +104,11 @@ install_wp() {
}
install_test_suite() {
if [ "$SKIP_TEST_SUITE_INSTALL" = "true" ]; then
echo "Skipping test suite installation."
return 0
fi
# portable in-place argument for both GNU sed and Mac OSX sed
if [[ $(uname -s) == 'Darwin' ]]; then
local ioption='-i.bak'
@ -178,6 +190,10 @@ install_db() {
}
install_wp_plugins() {
if [ "$SKIP_PLUGINS_INSTALL" = "true" ]; then
echo "Skipping WordPress plugin installation."
return 0
fi
download https://downloads.wordpress.org/plugin/activitypub.3.2.5.zip $TMPDIR/activitypub.zip
unzip $TMPDIR/activitypub.zip -d $WP_CORE_DIR/wp-content/plugins/
}