-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.09 KB
/
tests.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
name: Tests
on:
push:
branches:
- main
paths:
- '**.php'
- 'phpstan.neon.dist'
- 'composer.json'
pull_request:
branches:
- main
paths:
- '**.php'
- 'phpstan.neon.dist'
- 'composer.json'
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php:
- "8.2"
env:
extensions: ctype, dom, intl, json, mbstring, openssl, xml, zip, zlib
key: cache-v1 # can be any string, change to clear the extension cache.
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
tools: composer, pecl
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ramsey/composer-install@v2
with:
composer-options: "${{ matrix.composer-options }}"
- name: Setup Problem Matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run PHPMD
run: vendor/bin/phpmd src text ruleset.xml
- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer check --diff --verbose
- name: Run PHPStan
run: vendor/bin/phpstan
- name: Run Composer Require Checker
run: vendor/bin/composer-require-checker
- name: Run Roave Security Checker
run: composer update --dry-run roave/security-advisories