|
1 | 1 | name: CI
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: [ main ] |
6 |
| - pull_request: |
7 |
| - branches: [ main ] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
8 | 10 |
|
9 | 11 | jobs:
|
10 |
| - lint: |
11 |
| - runs-on: ubuntu-latest |
12 |
| - name: 'Lint' |
13 |
| - steps: |
14 |
| - - name: Checkout code |
15 |
| - uses: actions/checkout@v3 |
16 |
| - |
17 |
| - - name: Get composer cache directory |
18 |
| - id: composer-cache |
19 |
| - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
20 |
| - |
21 |
| - - name: Cache dependencies |
22 |
| - uses: actions/cache@v3 |
23 |
| - with: |
24 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
25 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
26 |
| - restore-keys: ${{ runner.os }}-composer- |
27 |
| - |
28 |
| - - name: Setup PHP |
29 |
| - uses: shivammathur/setup-php@v2 |
30 |
| - with: |
31 |
| - php-version: '8.1' |
32 |
| - coverage: pcov |
33 |
| - |
34 |
| - - name: Install dependencies |
35 |
| - run: composer update |
36 |
| - |
37 |
| - - name: Check platform requirements |
38 |
| - run: composer check-platform-reqs |
39 |
| - |
40 |
| - - name: PHP-CS-Fixer |
41 |
| - run: composer fix -- --dry-run |
42 |
| - |
43 |
| - # - name: composer normalize |
44 |
| - # run: composer normalize --dry-run --no-interaction --verbose |
45 |
| - |
46 |
| - # - name: test coverage |
47 |
| - # run: | |
48 |
| - # ./vendor/bin/phpunit --coverage-clover=coverage.xml --debug --verbose |
49 |
| - # bash <(curl -s https://codecov.io/bash) |
50 |
| - # env: |
51 |
| - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
52 |
| - |
53 |
| - # - name: Infection |
54 |
| - # run: ./vendor/bin/infection --show-mutations --min-covered-msi=100 --no-progress --no-interaction --verbose |
55 |
| - # env: |
56 |
| - # INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} |
57 |
| - |
58 |
| - # - name: Psalm |
59 |
| - # run: ./vendor/bin/psalm --shepherd --no-progress |
60 |
| - |
61 |
| - # - name: PHPStan |
62 |
| - # run: ./vendor/bin/phpstan --no-interaction --verbose |
63 |
| - # |
64 |
| - # composer-require-checker |
65 |
| - # composer-unused |
66 |
| - |
67 |
| - tests: |
68 |
| - runs-on: ubuntu-latest |
69 |
| - name: 'PHP: ${{ matrix.php }}; Laravel: ${{ matrix.laravel }}; Prefer: ${{ matrix.prefer }}' |
70 |
| - strategy: |
71 |
| - matrix: |
72 |
| - php: ['8.1', '8.2'] |
73 |
| - laravel: ['^9.0', '^10.0'] |
74 |
| - prefer: ['prefer-lowest', 'prefer-stable'] |
75 |
| - include: |
76 |
| - - testbench: '^7.0' |
77 |
| - laravel: '^9.0' |
78 |
| - - testbench: '^8.0' |
79 |
| - laravel: '^10.0' |
80 |
| - |
81 |
| - steps: |
82 |
| - - name: checkout code |
83 |
| - uses: actions/checkout@v3 |
84 |
| - |
85 |
| - - name: Get composer cache directory |
86 |
| - id: composer-cache |
87 |
| - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
88 |
| - |
89 |
| - - name: Cache dependencies |
90 |
| - uses: actions/cache@v3 |
91 |
| - with: |
92 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
93 |
| - key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-prefer-${{ matrix.prefer }}-composer-${{ hashFiles('**/composer.json') }} |
94 |
| - restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-laravel-{{ matrix.laravel }}-prefer-${{ matrix.prefer}}-composer- |
95 |
| - |
96 |
| - - name: Setup PHP |
97 |
| - uses: shivammathur/setup-php@v2 |
98 |
| - with: |
99 |
| - php-version: ${{ matrix.php }} |
100 |
| - coverage: none |
101 |
| - |
102 |
| - - name: Remove dev packages |
103 |
| - run: | |
104 |
| - composer remove --dev --no-update \ |
105 |
| - friendsofphp/php-cs-fixer \ |
106 |
| - infection/infection \ |
107 |
| - nunomaduro/larastan \ |
108 |
| - phpstan/phpstan-strict-rules |
109 |
| -
|
110 |
| - - name: Require Laravel and Testbench version |
111 |
| - run: composer require --no-update laravel/framework:"${{ matrix.laravel }}" illuminate/collections:"${{ matrix.laravel }}" illuminate/database:"${{ matrix.laravel }}" illuminate/http:"${{ matrix.laravel }}" illuminate/support:"${{ matrix.laravel }}" orchestra/testbench:"${{ matrix.testbench }}" |
112 |
| - |
113 |
| - - name: Support prefer-lowest in PHP 8.1 |
114 |
| - if: ${{ matrix.php == 8.1 && matrix.prefer == 'prefer-lowest' }} |
115 |
| - run: composer require --no-update nesbot/carbon:"^2.62.1" |
116 |
| - |
117 |
| - - name: Support prefer-lowest in PHP 8.2 |
118 |
| - if: ${{ matrix.php == 8.2 && matrix.prefer == 'prefer-lowest' }} |
119 |
| - run: composer require --no-update nesbot/carbon:"^2.62.1" |
120 |
| - |
121 |
| - - name: Install dependencies |
122 |
| - run: composer update --${{ matrix.prefer }} |
123 |
| - |
124 |
| - - name: Check platform requirements |
125 |
| - run: composer check-platform-reqs --verbose |
126 |
| - |
127 |
| - - name: Run tests |
128 |
| - run: composer test |
| 12 | + lint: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + name: Lint |
| 15 | + steps: |
| 16 | + - name: Checkout code |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - name: Get composer cache directory |
| 20 | + id: composer-cache |
| 21 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 22 | + |
| 23 | + - name: Cache dependencies |
| 24 | + uses: actions/cache@v3 |
| 25 | + with: |
| 26 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 27 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 28 | + restore-keys: ${{ runner.os }}-composer- |
| 29 | + |
| 30 | + - name: Setup PHP |
| 31 | + uses: shivammathur/setup-php@v2 |
| 32 | + with: |
| 33 | + php-version: '8.1' |
| 34 | + coverage: pcov |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + run: composer update |
| 38 | + |
| 39 | + - name: Check platform requirements |
| 40 | + run: composer check-platform-reqs |
| 41 | + |
| 42 | + - name: PHP-CS-Fixer |
| 43 | + run: composer fix -- --dry-run |
| 44 | + |
| 45 | + # - name: composer normalize |
| 46 | + # run: composer normalize --dry-run --no-interaction --verbose |
| 47 | + |
| 48 | + # - name: test coverage |
| 49 | + # run: "./vendor/bin/phpunit --coverage-clover=coverage.xml --debug --verbose && bash <(curl -s https://codecov.io/bash)" |
| 50 | + # env: |
| 51 | + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 52 | + |
| 53 | + # - name: Infection |
| 54 | + # run: "./vendor/bin/infection --show-mutations --min-covered-msi=100 --no-progress --no-interaction --verbose" |
| 55 | + # env: |
| 56 | + # INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} |
| 57 | + |
| 58 | + # - name: Psalm |
| 59 | + # run: ./vendor/bin/psalm --shepherd --no-progress |
| 60 | + |
| 61 | + # - name: PHPStan |
| 62 | + # run: ./vendor/bin/phpstan --no-interaction --verbose |
| 63 | + |
| 64 | + # composer-require-checker |
| 65 | + # composer-unused |
| 66 | + |
| 67 | + tests: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + name: "PHP: ${{ matrix.php }}; Laravel: ${{ matrix.laravel }}; Prefer: ${{ matrix.prefer }}" |
| 70 | + strategy: |
| 71 | + matrix: |
| 72 | + php: ['8.1', '8.2', '8.3'] |
| 73 | + laravel: [^9.0, ^10.0, ^11.0] |
| 74 | + prefer: [prefer-lowest, prefer-stable] |
| 75 | + include: |
| 76 | + - testbench: ^7.0 |
| 77 | + laravel: ^9.0 |
| 78 | + - testbench: ^8.0 |
| 79 | + laravel: ^10.0 |
| 80 | + - testbench: ^9.0 |
| 81 | + laravel: ^11.0 |
| 82 | + exclude: |
| 83 | + - laravel: ^11.0 |
| 84 | + php: '8.1' |
| 85 | + |
| 86 | + steps: |
| 87 | + - name: checkout code |
| 88 | + uses: actions/checkout@v3 |
| 89 | + |
| 90 | + - name: Get composer cache directory |
| 91 | + id: composer-cache |
| 92 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 93 | + |
| 94 | + - name: Cache dependencies |
| 95 | + uses: actions/cache@v3 |
| 96 | + with: |
| 97 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 98 | + key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-prefer-${{ matrix.prefer }}-composer-${{ hashFiles('**/composer.json') }} |
| 99 | + restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-laravel-{{ matrix.laravel }}-prefer-${{ matrix.prefer}}-composer- |
| 100 | + |
| 101 | + - name: Setup PHP |
| 102 | + uses: shivammathur/setup-php@v2 |
| 103 | + with: |
| 104 | + php-version: ${{ matrix.php }} |
| 105 | + coverage: none |
| 106 | + |
| 107 | + - name: Remove dev packages |
| 108 | + run: | |
| 109 | + composer remove --dev --no-update \ |
| 110 | + friendsofphp/php-cs-fixer \ |
| 111 | + infection/infection \ |
| 112 | + nunomaduro/larastan \ |
| 113 | + phpstan/phpstan-strict-rules |
| 114 | +
|
| 115 | + - name: Require Laravel and Testbench version |
| 116 | + run: composer require --no-update laravel/framework:"${{ matrix.laravel }}" illuminate/collections:"${{ matrix.laravel }}" illuminate/database:"${{ matrix.laravel }}" illuminate/http:"${{ matrix.laravel }}" illuminate/support:"${{ matrix.laravel }}" orchestra/testbench:"${{ matrix.testbench }}" |
| 117 | + |
| 118 | + - name: Support prefer-lowest in PHP 8.1 |
| 119 | + if: ${{ matrix.php == 8.1 && matrix.prefer == 'prefer-lowest' }} |
| 120 | + run: composer require --no-update nesbot/carbon:"^2.62.1" |
| 121 | + |
| 122 | + - name: Support prefer-lowest in PHP 8.2 |
| 123 | + if: ${{ matrix.php == 8.2 && matrix.prefer == 'prefer-lowest' }} |
| 124 | + run: composer require --no-update nesbot/carbon:"^2.62.1" |
| 125 | + |
| 126 | + - name: Support prefer-lowest in PHP 8.3 |
| 127 | + if: ${{ matrix.php == 8.3 && matrix.prefer == 'prefer-lowest' }} |
| 128 | + run: composer require --no-update nesbot/carbon:"^2.62.1" |
| 129 | + |
| 130 | + - name: Install dependencies |
| 131 | + run: composer update --${{ matrix.prefer }} |
| 132 | + |
| 133 | + - name: Check platform requirements |
| 134 | + run: composer check-platform-reqs --verbose |
| 135 | + |
| 136 | + - name: Run tests |
| 137 | + run: composer test |
0 commit comments