-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.6 KB
/
Copy pathmain.yml
File metadata and controls
58 lines (51 loc) · 1.6 KB
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
name: CI
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1, 8.2]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: imap, mbstring
coverage: none
- name: Get Composer Cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: Run PHPStan (level 8)
# adjust path or config if needed
run: |
if [ -f phpstan.neon ]; then
./vendor/bin/phpstan analyse --configuration=phpstan.neon --level=8 src tests || true
else
./vendor/bin/phpstan analyse --level=8 src tests || true
fi
- name: Run tests
# try PHPUnit first; adjust if you use Pest or other runner
run: |
if [ -x ./vendor/bin/phpunit ]; then
./vendor/bin/phpunit --configuration phpunit.xml --colors=always --testdox
elif [ -x ./vendor/bin/pest ]; then
./vendor/bin/pest --min
else
echo "No test runner found (phpunit/pest). Ensure composer install created vendor binaries."
exit 1
fi