|
6 | 6 | - main |
7 | 7 | - '*.x' |
8 | 8 | pull_request: |
9 | | - schedule: |
10 | | - - cron: '0 0 * * *' |
11 | | - |
12 | | -permissions: |
13 | | - contents: read |
14 | 9 |
|
| 10 | +# Laravel 12 temporarily limited to <12.38.0 due to https://github.com/orchestral/canvas/issues/47 |
15 | 11 | jobs: |
16 | 12 | tests: |
17 | 13 | runs-on: ubuntu-latest |
18 | | - |
19 | 14 | strategy: |
20 | 15 | fail-fast: false |
21 | 16 | matrix: |
22 | | - php: [ '7.3', '7.4', '8.0', '8.1', '8.2' ] |
23 | | - laravel: [^8] |
| 17 | + php: [8.3, 8.4] |
| 18 | + laravel: ["^11.44.7", "^12.0 <12.38.0"] |
24 | 19 | dependency-version: [prefer-stable] |
| 20 | + include: |
| 21 | + - laravel: "^12.0 <12.38.0" |
| 22 | + testbench: "10.6.*" |
| 23 | + - laravel: "^11.44.7" |
| 24 | + testbench: "9.15.*" |
25 | 25 |
|
26 | 26 | name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} |
27 | 27 |
|
28 | 28 | steps: |
29 | 29 | - name: Checkout code |
30 | | - uses: actions/checkout@v3 |
31 | | - with: |
32 | | - fetch-depth: 10 |
| 30 | + uses: actions/checkout@v4 |
33 | 31 |
|
34 | 32 | - name: Setup PHP |
35 | 33 | uses: shivammathur/setup-php@v2 |
36 | 34 | with: |
37 | 35 | php-version: ${{ matrix.php }} |
| 36 | + extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv |
38 | 37 | coverage: xdebug |
39 | 38 |
|
| 39 | + - name: Setup problem matchers |
| 40 | + run: | |
| 41 | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 42 | + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 43 | +
|
40 | 44 | - name: Install dependencies |
41 | 45 | run: | |
42 | | - composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update |
43 | | - composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress |
| 46 | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update |
| 47 | + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction |
44 | 48 |
|
45 | 49 | - name: Execute tests |
| 50 | + env: |
| 51 | + XDEBUG_MODE: coverage |
46 | 52 | run: vendor/bin/phpunit |
47 | 53 |
|
48 | 54 | - name: PHPStan Static Analysis |
49 | 55 | uses: php-actions/phpstan@v3 |
50 | 56 | with: |
51 | 57 | path: src/ |
52 | 58 |
|
53 | | - - name: Upload Scrutinizer coverage |
54 | | - uses: sudo-bot/action-scrutinizer@latest |
| 59 | + phpcs: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v4 |
| 64 | + |
| 65 | + - name: Setup PHP |
| 66 | + uses: shivammathur/setup-php@v2 |
55 | 67 | with: |
56 | | - cli-args: "--format=php-clover tests/reports/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" |
| 68 | + php-version: 8.4 |
| 69 | + tools: cs2pr, phpcs |
| 70 | + |
| 71 | + - name: Setup phpcs config |
| 72 | + run: | |
| 73 | + { |
| 74 | + echo '<?xml version="1.0"?>' |
| 75 | + echo '<ruleset name="DD Detection Standard">' |
| 76 | + echo '<description>Detects and fails for dd found in code.</description>' |
| 77 | + echo '<arg name="colors"/>' |
| 78 | + echo '<arg value="n"/>' |
| 79 | + echo '<rule ref="Generic.PHP.ForbiddenFunctions">' |
| 80 | + echo '<properties>' |
| 81 | + echo '<property name="forbiddenFunctions" type="array">' |
| 82 | + echo '<element key="dd" value="null"/>' |
| 83 | + echo '</property>' |
| 84 | + echo '</properties>' |
| 85 | + echo '</rule>' |
| 86 | + echo '</ruleset>' |
| 87 | + } > custom_phpcs_style.xml |
| 88 | + |
| 89 | + - name: Run PHP CS Fixer |
| 90 | + run: | |
| 91 | + (phpcs --standard=custom_phpcs_style.xml --report=checkstyle src | cs2pr) || true |
| 92 | + phpcs --standard=custom_phpcs_style.xml src |
57 | 93 | pint: |
58 | | - uses: intouchinsight/github-workflows/.github/workflows/laravel-pint.yml@main |
59 | | - with: |
60 | | - php_version: '8.3' |
| 94 | + runs-on: ubuntu-latest |
| 95 | + steps: |
| 96 | + - name: Checkout |
| 97 | + uses: actions/checkout@v4 |
| 98 | + |
| 99 | + - name: Find pint version |
| 100 | + id: find_pint_version |
| 101 | + run: | |
| 102 | + PINT_VERSION='v1.25.1' |
| 103 | + echo "Attempting to load pint version from composer.lock" |
| 104 | + if [ -f composer.lock ]; then |
| 105 | + PINT_VERSION=$(jq '.["packages-dev"][] | select(.name == "laravel/pint") | .version' composer.lock) |
| 106 | + fi |
| 107 | + echo "Found pint version: $PINT_VERSION" |
| 108 | + echo "PINT_VERSION=$PINT_VERSION" >> $GITHUB_OUTPUT |
| 109 | +
|
| 110 | + - name: Setup PHP |
| 111 | + uses: shivammathur/setup-php@v2 |
| 112 | + with: |
| 113 | + php-version: 8.4 |
| 114 | + tools: cs2pr, pint:${{ steps.find_pint_version.outputs.PINT_VERSION }} |
| 115 | + |
| 116 | + - name: Run pint |
| 117 | + run: | |
| 118 | + (pint --test --format=checkstyle | cs2pr) || true |
| 119 | + pint --test -v --ansi |
0 commit comments