Merge pull request #2434 from elcreator/fix-docker-port #54
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: CI | |
| on: | |
| push: | |
| branches: | |
| - '3.*.x' | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PHP_EXTENSIONS: ctype, dom, fileinfo, filter, iconv, intl, json, mbstring, openssl, pdo, pdo_sqlite, readline, simplexml, tokenizer, xml, xmlreader, zip | |
| jobs: | |
| analyze: | |
| name: Static analysis (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.3', '8.4'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: ${{ env.PHP_EXTENSIONS }} | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache composer downloads | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ runner.os }}-php${{ matrix.php }}-analyze-${{ hashFiles('composer.json') }} | |
| restore-keys: composer-${{ runner.os }}-php${{ matrix.php }}-analyze- | |
| # Only the root dependencies (PHPStan) are installed here: | |
| # core/vendor is committed and provides everything phpstan.neon bootstraps. | |
| - name: Install root dependencies | |
| run: composer install --no-interaction --no-progress --prefer-dist | |
| - name: Run PHPStan | |
| run: composer analyze | |
| tests: | |
| name: Unit tests (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.3', '8.4'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: ${{ env.PHP_EXTENSIONS }} | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache composer downloads | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ runner.os }}-php${{ matrix.php }}-core-${{ hashFiles('core/composer.lock') }} | |
| restore-keys: composer-${{ runner.os }}-php${{ matrix.php }}-core- | |
| - name: Install core dependencies | |
| working-directory: core | |
| run: composer install --no-interaction --no-progress --prefer-dist | |
| - name: Run Pest | |
| working-directory: core | |
| run: composer test -- --compact |