feat: PHPStan extension #119
Workflow file for this run
This file contains hidden or 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: Tests | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| phpunit: | |
| name: PHPUnit on PHP v${{ matrix.php }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| php: [ 8.2, 8.3, 8.4 ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Execute phpunit | |
| run: composer test -- --colors=always | |
| php-cs-fixer: | |
| name: php-cs-fixer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| extensions: dom, curl, libxml, mbstring, zip | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Execute php-cs-fixer | |
| run: composer cs-fix -- --dry-run --diff --using-cache=no | |
| phpstan: | |
| name: PHPStan on PHP v${{ matrix.php }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| php: [ 8.2, 8.3, 8.4 ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Execute phpstan | |
| run: composer phpstan | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Build and run | |
| run: | | |
| docker compose build docs --build-arg CONTAINER_ENV=production | |
| docker compose up -d --wait docs | |
| - name: Check they are available | |
| run: docker compose exec docs wget -O- -q http://localhost | grep "Installation | Good PHP Reflection" |