Merge pull request #237 from clue-labs/reactive-fibers #361
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
name: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
PHPUnit: | |
name: PHPUnit (PHP ${{ matrix.php }} on ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- windows-2022 | |
php: | |
- 8.2 | |
- 8.1 | |
- 8.0 | |
- 7.4 | |
- 7.3 | |
- 7.2 | |
- 7.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: xdebug | |
ini-file: development | |
- run: composer install | |
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml | |
if: ${{ matrix.php >= 7.3 }} | |
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy | |
if: ${{ matrix.php < 7.3 }} | |
- name: Check 100% code coverage | |
shell: php {0} | |
run: | | |
<?php | |
$metrics = simplexml_load_file('clover.xml')->project->metrics; | |
exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1); | |
PHPStan: | |
name: PHPStan (PHP ${{ matrix.php }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- 8.2 | |
- 8.1 | |
- 8.0 | |
- 7.4 | |
- 7.3 | |
- 7.2 | |
- 7.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
- run: composer install | |
- run: vendor/bin/phpstan | |
Built-in-webserver: | |
name: Built-in webserver (PHP ${{ matrix.php }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- 8.2 | |
- 8.1 | |
- 8.0 | |
- 7.4 | |
- 7.3 | |
- 7.2 | |
- 7.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- run: composer install -d tests/install-as-dep/ | |
- run: php tests/install-as-dep/public/index.php & | |
- run: bash tests/await.sh | |
- run: bash tests/acceptance.sh | |
Docker: | |
name: Docker (${{ matrix.dockerfile }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
dockerfile: | |
- "Dockerfile-basics" | |
- "Dockerfile-production" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- run: composer install -d tests/install-as-dep/ | |
- run: docker build -f tests/${{ matrix.dockerfile }} tests/install-as-dep/ | |
- run: docker run -d -p 8080:8080 -v "$PWD/examples/index.php":/app/public/index.php -v "$PWD/composer.json":/app/composer.json -v "$PWD/LICENSE":/app/LICENSE -v "$PWD/tests/":/app/tests/ $(docker images -q | head -n1) | |
- run: bash tests/await.sh | |
- run: bash tests/acceptance.sh | |
- run: docker stop $(docker ps -qn1) | |
- run: docker logs $(docker ps -qn1) | |
if: ${{ always() }} | |
nginx-webserver: | |
name: nginx + PHP-FPM (PHP ${{ matrix.php }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- 8.2 | |
- 8.1 | |
- 8.0 | |
- 7.4 | |
- 7.3 | |
- 7.2 | |
- 7.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- run: composer install -d tests/install-as-dep/ | |
- run: docker run -d -v "$PWD/tests/install-as-dep/":/home/framework-x/ -v "$PWD/examples/index.php":/home/framework-x/public/index.php -v "$PWD/LICENSE":/home/framework-x/LICENSE -v "$PWD/tests/":/home/framework-x/tests/ php:${{ matrix.php }}-fpm | |
- run: docker run -d -p 80:80 --link $(docker ps -qn1):php -v "$PWD/tests/install-as-dep/":/home/framework-x/ -v "$PWD"/examples/nginx/nginx.conf:/etc/nginx/conf.d/default.conf nginx:stable-alpine | |
- run: bash tests/await.sh http://localhost | |
- run: bash tests/acceptance.sh http://localhost | |
Apache-webserver: | |
name: Apache webserver (PHP ${{ matrix.php }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- 8.2 | |
- 8.1 | |
- 8.0 | |
- 7.4 | |
- 7.3 | |
- 7.2 | |
- 7.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- run: composer install -d tests/install-as-dep/ | |
- run: docker run -d -p 80:80 -v "$PWD/tests/install-as-dep/":/home/framework-x/ -v "$PWD/examples/index.php":/home/framework-x/public/index.php -v "$PWD/LICENSE":/home/framework-x/LICENSE -v "$PWD/tests/":/home/framework-x/tests/ -v "$PWD/examples/apache/.htaccess":/home/framework-x/public/.htaccess php:${{ matrix.php }}-apache sh -c "rmdir /var/www/html;ln -s /home/framework-x/public /var/www/html;ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground" | |
- run: bash tests/await.sh http://localhost | |
- run: bash tests/acceptance.sh http://localhost | |
PHP-webserver: | |
name: PHP webserver (PHP ${{ matrix.php }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- 8.2 | |
- 8.1 | |
- 8.0 | |
- 7.4 | |
- 7.3 | |
- 7.2 | |
- 7.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- run: composer install -d tests/install-as-dep/ | |
- run: php -S localhost:8080 tests/install-as-dep/public/index.php & | |
- run: bash tests/await.sh | |
- run: bash tests/acceptance.sh |