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