Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHPUnit tests across all packages #55

Merged
merged 83 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
6ae9649
test(phpcs): add a phpcs script for the monorepo to manage phpcs test…
JoelAlphonso Aug 8, 2022
e6ad662
fix(phpcs): exit execution after -l option
JoelAlphonso Aug 9, 2022
3b9ae85
test(phpunit): add a phpunit script to to run phpunit for one package…
JoelAlphonso Aug 9, 2022
6efbe4f
test(phpcs): add a --ci option to phpcs script
JoelAlphonso Aug 9, 2022
89b1cea
ci(action): (wip) add a php testing suite github action
JoelAlphonso Aug 9, 2022
f7bd567
ci(action): fix jobs interdependencies
JoelAlphonso Aug 9, 2022
191d815
build(composer): update composer dependencies
JoelAlphonso Aug 9, 2022
38cba0c
ci(php): remove strict option on composer temporarily
JoelAlphonso Aug 9, 2022
ac8700a
ci(php): fix phpcs call
JoelAlphonso Aug 9, 2022
90c7188
ci(php): add missing composer dependencies
JoelAlphonso Aug 9, 2022
62f2017
ci(phpunit): add --ci option to phpunit script
JoelAlphonso Aug 10, 2022
7d8e265
ci(phpcs): fix ci option for phpcs script
JoelAlphonso Aug 10, 2022
8433d3c
ci(php): add phpunit script to php action and fix script options
JoelAlphonso Aug 10, 2022
4768582
ci(php): test raw phpunit command
JoelAlphonso Aug 10, 2022
609a318
ci(php): test raw phpunit command
JoelAlphonso Aug 10, 2022
4e91011
ci(php): test phpunit through `sh -c`
JoelAlphonso Aug 10, 2022
eb5a87a
ci(php): relay exit codes
JoelAlphonso Aug 10, 2022
3f94314
fix(composer): fix some composer conflicting packages
JoelAlphonso Aug 11, 2022
c97c2e3
fix(view): the view prop and method should be allowed to be null
JoelAlphonso Aug 18, 2022
5517d6d
tests(cms): fix metadata paths for package dependencies
JoelAlphonso Aug 18, 2022
01b8e5a
fix(cms): fix TemplateableTrait.php templateIdent property to be defa…
JoelAlphonso Aug 18, 2022
fc8d6bf
fix(cms): fix missing property type
JoelAlphonso Aug 18, 2022
819f5a0
fix(template-ident): uniformize template-ident return types
JoelAlphonso Aug 18, 2022
a7a44fb
fix(cache): fix composer dev requirement for slim
JoelAlphonso Aug 18, 2022
954b5b9
tests(cache): fix and upgrade phpunit tests
JoelAlphonso Aug 18, 2022
f937aa0
tests(cms): fix and upgrade phpunit tests
JoelAlphonso Aug 18, 2022
063e604
tests(cms): fix path casing
JoelAlphonso Aug 18, 2022
a120fe8
tests(cms): fix config path for object vendor
JoelAlphonso Aug 18, 2022
01ab097
tests(admin): fix and upgrade phpunit tests
JoelAlphonso Aug 18, 2022
aa09fb3
tests(app): instantiate the app config to provide app paths
JoelAlphonso Aug 18, 2022
6ce9534
tests(app): remove test that tested nothing
JoelAlphonso Aug 18, 2022
2408e37
tests(packages): batch fix setUp method declaration
JoelAlphonso Aug 18, 2022
ce6c7b2
tests(packages): batch fix metadata paths for container providers
JoelAlphonso Aug 18, 2022
e31abcc
tests(config): make path to fixtures relative
JoelAlphonso Aug 19, 2022
e3cc52c
tests(config): fix phpunit tests
JoelAlphonso Aug 19, 2022
6c4049e
tests(charcoal): add phpunit config and bootstrap
JoelAlphonso Aug 19, 2022
6fadceb
fix(core): add exception thrown when metadata file cannot be loaded
JoelAlphonso Aug 19, 2022
c06c873
test(charcoal): add deprecation conversion to exception in phpunit.xm…
JoelAlphonso Sep 6, 2022
61a0408
test(core): add deprecation conversion to exception in phpunit.xml.dist
JoelAlphonso Sep 6, 2022
5f76cec
fix(core): add exception thrown when source ident is not defined
JoelAlphonso Sep 6, 2022
04a0391
fix(core): revert loadfile() changes because it caused unexpected issues
JoelAlphonso Sep 6, 2022
19e2b23
style(core): fix typo
JoelAlphonso Sep 6, 2022
8e4d900
test(core): fix unit tests
JoelAlphonso Sep 6, 2022
44b6302
test(email): fix unit tests
JoelAlphonso Sep 6, 2022
18b5923
test(charcoal): change the way bootstrap files are loaded based on en…
JoelAlphonso Sep 6, 2022
3edd141
test(factory): fix unit tests for factory package
JoelAlphonso Sep 7, 2022
e96b913
test(image): fix test boostrap
JoelAlphonso Sep 7, 2022
8293e99
fix(image): fix radial blur effect renamed to rotational blur
JoelAlphonso Sep 7, 2022
feec80b
test(object): fix unit tests for object package
JoelAlphonso Sep 7, 2022
8abc2f6
test(property): fix unit tests for property package
JoelAlphonso Sep 7, 2022
66e5f3c
test(translator): fix unit tests for translator package
JoelAlphonso Sep 7, 2022
398754f
test(ui): fix unit tests for ui package
JoelAlphonso Sep 7, 2022
d1f7260
test(user): fix unit tests for user package
JoelAlphonso Sep 7, 2022
38cf504
test(view): fix unit tests for view package
JoelAlphonso Sep 7, 2022
d045a60
test(view): fix unit tests for view package
JoelAlphonso Sep 7, 2022
5fa065a
chore(charcoal): update composer lock file
JoelAlphonso Sep 7, 2022
2db7a17
fix(charcoal): fix bad find and replace
JoelAlphonso Sep 8, 2022
7383b5f
fix(app): fix deleted method visibility
JoelAlphonso Sep 8, 2022
577e414
fix(charcoal): fix bad find and replace
JoelAlphonso Sep 8, 2022
0d48576
fix(composer): move composer.json replace section for locomotivemtl p…
JoelAlphonso Sep 8, 2022
63968e8
chore(composer): update composer lock file
JoelAlphonso Sep 8, 2022
dc26eff
ci(php): remove composer vendor caching since the install scripts alr…
JoelAlphonso Sep 8, 2022
cc8f3fd
style(php): remove unneeded comments and fix typo
JoelAlphonso Sep 8, 2022
12e6b9b
doc(php): improve php script documentation
JoelAlphonso Sep 8, 2022
87621ea
style(php): improve php script readability and comments
JoelAlphonso Sep 8, 2022
110cd53
style(phpunit): fix alphabetical sorting of non-namespace declaration…
JoelAlphonso Sep 8, 2022
edf9fc6
style(phpcs): improve phpcs script's readability and fix some typos
JoelAlphonso Sep 8, 2022
4aa79fa
ci(phpcs): display full report for phpcs script
JoelAlphonso Sep 8, 2022
9ac4d69
style(phpunit): improve readability for phpunit script
JoelAlphonso Sep 8, 2022
ef066bc
style(monorepo-builder): add missing trailing comma
JoelAlphonso Sep 8, 2022
c92258b
stylee(php): remove unnecessary comment
JoelAlphonso Sep 8, 2022
e13e43e
fix(phpunit.xml.dist): add xsi:noNamespaceSchemaLocation
JoelAlphonso Sep 8, 2022
b7170ad
refactor(templateable-trait): remove default value for templateIdent
JoelAlphonso Sep 8, 2022
8c03298
build(translator): set admin dev dependency version to '*'
JoelAlphonso Sep 8, 2022
01ea69b
refactor(view): fix templateIdent return type
JoelAlphonso Sep 8, 2022
3b42ff0
build(composer): build composer lock file
JoelAlphonso Sep 8, 2022
49e755f
fix(php): add redis extension to php github action
JoelAlphonso Sep 8, 2022
314e1c9
Revert "refactor(templateable-trait): remove default value for templa…
JoelAlphonso Sep 8, 2022
02ef2be
Revert "refactor(view): fix templateIdent return type"
JoelAlphonso Sep 8, 2022
c9fe2a2
ci(php): add redis server initialisation for cache package
JoelAlphonso Sep 8, 2022
b36e82b
refactor(php8-1): add some return types to ArrayAccess implementation…
JoelAlphonso Sep 8, 2022
6b28b7d
ci(php): change php version 8.1 for 8.0 in php github script
JoelAlphonso Sep 8, 2022
38d93a2
Revert "refactor(php8-1): add some return types to ArrayAccess implem…
JoelAlphonso Sep 8, 2022
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
81 changes: 81 additions & 0 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: PHP testing

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
provide_packages_json:
# Provides package paths in JSON format for
# use in the matrix strategy of other jobs.
#
# The paths will be passed as arguments
# to linting and testing tools.
#
# * https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson
# * https://stackoverflow.com/a/62953566/1348344

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Output list of packages as JSON
id: output_data
run: echo "::set-output name=matrix::$(vendor/bin/monorepo-builder packages-json)"

outputs:
matrix: ${{ steps.output_data.outputs.matrix }}

test:
needs: provide_packages_json

runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.4', '8.0']
package: ${{fromJson(needs.provide_packages_json.outputs.matrix)}}

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json, mbstring, pdo, redis
coverage: xdebug
tools: composer, phpcs, phpstan, phpunit

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Start Redis
if: ${{ matrix.package == 'cache' }}
uses: supercharge/[email protected]
with:
redis-version: 6

- name: Run PHPCS for all packages
run: tests/script/phpcs --ci ${{ matrix.package }}

- name: Run PHPunit for all packages
run: tests/script/phpunit --ci ${{ matrix.package }}
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"php-coveralls/php-coveralls": "^2.2",
"phpstan/phpstan": "^1.6",
"phpunit/phpunit": "^9.5",
"slim/http": "^1.2",
"squizlabs/php_codesniffer": "^3.5",
"symfony/yaml": "^3.0",
"symplify/monorepo-builder": "^10.2",
Expand Down Expand Up @@ -152,9 +151,9 @@
"@phpunit"
],
"phplint": "find packages -type f -name '*.php' -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1",
"phpcs": "php vendor/bin/phpcs -ps --colors packages/*/src/ --ignore=tests/",
"phpcs": "./tests/script/phpcs",
"phpcbf": "php vendor/bin/phpcbf -ps --colors packages/*/src/ --ignore=tests/",
"phpunit": "php vendor/bin/phpunit --coverage-text",
"phpunit": "./tests/script/phpunit",
"phpstan": "vendor/bin/phpstan analyse packages/*/src packages/*/tests"
JoelAlphonso marked this conversation as resolved.
Show resolved Hide resolved
},
"minimum-stability": "dev",
Expand Down
Loading