Merge pull request #82 from nanasess/worktree-feat+symfony-compat-rou… #484
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, pull_request] | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| jobs: | |
| php-cs-fixer: | |
| name: PHP-CS-Fixer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install dependencies | |
| uses: php-actions/composer@8a65f0d3c6a1d17ca4800491a40b5756a4c164f3 # v6 | |
| with: | |
| php_version: '8.1' | |
| - name: Run PHP-CS-Fixer | |
| run: vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes | |
| phpstan: | |
| name: PHPStan | |
| needs: php-cs-fixer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install dependencies | |
| uses: php-actions/composer@8a65f0d3c6a1d17ca4800491a40b5756a4c164f3 # v6 | |
| with: | |
| php_version: '8.1' | |
| - name: Run PHPStan | |
| uses: php-actions/phpstan@d8f8887acaac249b05ac11909c4cdbb018f52211 # v3 | |
| with: | |
| php_version: '8.1' | |
| tests: | |
| name: Tests | |
| needs: phpstan | |
| timeout-minutes: 10 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| - name: Composer Install | |
| run: composer install --no-interaction --no-cache | |
| - name: PHPUnit | |
| run: vendor/bin/phpunit | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| tests-without-bcmath: | |
| name: Tests (without BCMath extension) | |
| needs: phpstan | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: :bcmath # ubuntu only | |
| - name: Composer Install | |
| run: composer install --no-interaction --no-cache | |
| - name: PHPUnit (without BCMath extension) | |
| run: vendor/bin/phpunit --group without-bcmath | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] | |
| docker-phpt-tests: | |
| name: Docker PHPT Tests | |
| needs: phpstan | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Checkout php-src repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| repository: php/php-src | |
| path: php-src | |
| - name: Build Docker test image | |
| run: docker build -f Dockerfile.test-without-bcmath --build-arg PHP_VERSION=${{ matrix.php-version }} -t bcmath-phpt-test:${{ matrix.php-version }} . | |
| - name: Run Docker-based PHPT tests | |
| run: | | |
| # scale_ini test skipped: bcmath.scale INI setting ignored without native extension | |
| # gh20006 test skipped: requires BcMath\Number OOP API (not supported by polyfill) | |
| # bcround_precision_bounds test skipped: requires BcMath\Number OOP API (not supported by polyfill) | |
| # bcround directional modes + bcdivmod are now implemented, so those phpt tests no longer need skipping. | |
| docker run --rm -v $PWD:/app bcmath-phpt-test:${{ matrix.php-version }} --skip bug54598,bug72093,bug75178,gh15968,gh16262,scale_ini,bcmul_check_overflow,bug78878,bcpow_error1,bcpow_error2,bcpow_error3,bcpowmod_error,bcpowmod_with_mod_1,bcpowmod_zero_modulus,bcscale_variation003,gh20006,bcround_precision_bounds | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] |