-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
143 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Nette Tester" | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [8.2, 8.3] | ||
|
||
fail-fast: false | ||
|
||
name: Nette Tester - ${{matrix.php}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: xdebug | ||
|
||
- run: make tester |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "PHP Linter" | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [8.2, 8.3] | ||
|
||
fail-fast: false | ||
|
||
name: PHP Linter - ${{matrix.php}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- run: make phplint |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "PHPStan" | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [8.2, 8.3] | ||
|
||
fail-fast: false | ||
|
||
name: PHPStan - ${{matrix.php}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- run: make phpstan |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/bin | ||
/vendor | ||
/composer.lock |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
help: | ||
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n" | ||
@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: install | ||
install: install-composer vendor ## Installs all project dependencies | ||
|
||
.PHONY: install-composer | ||
install-composer: | ||
@[ -f bin/composer ] \ | ||
|| (echo '> Installing composer...' \ | ||
&& php -r 'copy("https://getcomposer.org/installer", "composer-setup.php");' \ | ||
&& php -r 'if (hash_file("sha384", "composer-setup.php") === file_get_contents("https://composer.github.io/installer.sig")) { echo "Installer verified"; } else { echo "Installer corrupt"; unlink("composer-setup.php"); } echo PHP_EOL;' \ | ||
&& mkdir -p bin \ | ||
&& php composer-setup.php --install-dir=bin --filename=composer --2 \ | ||
&& rm composer-setup.php) | ||
|
||
vendor: composer.json $(wildcard composer.lock) | ||
@echo '> composer install...' \ | ||
&& bin/composer install \ | ||
&& echo '' | ||
|
||
.PHONY: ci | ||
ci: phplint phpstan tester ## Runs complete CI suite | ||
|
||
.PHONY: phplint | ||
phplint: install | ||
@echo '> PHP linter ...' | ||
@php vendor/bin/parallel-lint src/ tests/ --colors --no-progress | ||
@echo '' | ||
|
||
.PHONY: phpstan | ||
phpstan: install | ||
@echo '> PHPStan ...' | ||
@php vendor/bin/phpstan analyse --no-progress | ||
|
||
.PHONY: tester | ||
tester: install | ||
@echo '> Nette Tester ...' | ||
@php vendor/bin/tester tests/ -C --colors --coverage tests/coverage.html --coverage-src src/ |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
parameters: | ||
level: max | ||
paths: | ||
- src/ | ||
- tests/ |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Simplex\Tests; | ||
|
||
use Tester\Environment; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
Environment::setup(); |