-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (68 loc) · 1.97 KB
/
Copy pathtests.yml
File metadata and controls
85 lines (68 loc) · 1.97 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
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
name: Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
phpunit:
runs-on: ubuntu-latest
name: PHPUnit Tests
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: nextcloud
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=10
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: pdo, pdo_mysql
- name: Install Dependencies
run: |
composer install --no-interaction --prefer-dist
- name: Run PHPUnit Tests
run: |
vendor/bin/phpunit -c phpunit.xml --colors=always
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_NAME: nextcloud
DB_USER: root
DB_PASSWORD: rootpassword
phpstan:
runs-on: ubuntu-latest
name: PHPStan Analysis
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Install PHPStan
run: |
composer require --dev phpstan/phpstan --no-interaction
- name: Run PHPStan
run: |
vendor/bin/phpstan analyse lib/ --level=5 --memory-limit=512M
php-cs-fixer:
runs-on: ubuntu-latest
name: Code Style Check
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Install Coding Standard
run: |
composer require --dev friendsofphp/php-cs-fixer --no-interaction
- name: Run PHP-CS-Fixer
run: |
vendor/bin/php-cs-fixer fix --dry-run --diff --rules=@PSR12 lib/