Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PHPUnit

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
php-matrix:
name: PHP matrix
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.php-matrix.outputs.versions }}
steps:
- uses: actions/checkout@v5

- uses: typisttech/php-matrix-action@0545a7d54db2c7be158b615b1e7f458ae6e99ad3 # v3.0.2
id: php-matrix

phpunit:
name: PHPUnit (PHP ${{ matrix.php }})
needs: php-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
services:
mariadb:
image: mariadb:11
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: wordpress_test
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=5s
--health-timeout=5s
--health-retries=10
env:
WP_TESTS_DB_HOST: 127.0.0.1
WP_TESTS_DB_NAME: wordpress_test
WP_TESTS_DB_USER: root
WP_TESTS_DB_PASSWORD: root
steps:
- uses: actions/checkout@v5

- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php }}
extensions: mysqli
coverage: none
tools: composer

- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # 3.2.1

- run: composer test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
languages/*.mo
/vendor/
/vendor-bin/*/vendor/
/.phpunit.result.cache
37 changes: 34 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,66 @@
"description": "WordPress theme for the LibreSign SaaS",
"type": "wordpress-theme",
"license": "GPL-2.0-or-later",
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org",
"only": [
"wpackagist-plugin/*"
]
}
],
"require": {
"php": ">=8.3 <8.6"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8"
"bamarni/composer-bin-plugin": "^1.8",
"composer/installers": "^2.3",
"roots/wordpress": "^7.0",
"wp-phpunit/wp-phpunit": "^7.0",
"wpackagist-plugin/woocommerce": "^11.0"
},
"autoload-dev": {
"psr-4": {
"LibreSign\\WordPressTheme\\Tests\\": "tests/"
}
},
"config": {
"platform": {
"php": "8.3"
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
"bamarni/composer-bin-plugin": true,
"composer/installers": true,
"roots/wordpress-core-installer": true
}
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": true
},
"wordpress-install-dir": "vendor/wordpress",
"installer-paths": {
"vendor/test-plugins/{$name}/": [
"type:wordpress-plugin"
]
}
},
"scripts": {
"lint": "parallel-lint --exclude vendor --exclude vendor-bin .",
"cs": "phpcs",
"cs:fix": "phpcbf",
"stan": "phpstan analyse --memory-limit=2G",
"test": [
"@test:integration"
],
"test:integration": "phpunit -c phpunit-integration.xml.dist",
"ci": [
"@lint",
"@cs",
"@stan"
"@stan",
"@test"
]
}
}
Loading
Loading