-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (64 loc) · 2.1 KB
/
checks.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
name: Check Build
on: [pull_request]
jobs:
build:
strategy:
matrix:
php: ["8.2", "8.3", "8.4"]
composer_args:
- '--prefer-lowest'
- ''
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2
- name: Prepare environment
run: |
mkdir -p /root/.ssh
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
echo "COMPOSER_CACHE=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Composer Cache
uses: actions/cache@v4
with:
path: |
${{ env.COMPOSER_CACHE }}
vendor
key: ${{ runner.os }}-composer
- name: Install dependencies
run: |
composer update --no-progress --no-interaction ${{ matrix.composer_args }} > /dev/null
- name: Check Dependencies
run: composer check-deps
- name: Check Code Style
run: PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check
- name: PHPStan
run: composer phpstan -- --no-progress
- name: Psalm
run: composer psalm
- name: Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml --stop-on-failure
composer run --timeout=0 infection
- name: Save Infection result
uses: actions/upload-artifact@v4
if: always()
with:
name: infection-log-${{ matrix.php }}.txt
path: infection-log.txt
- name: Monitor coverage
if: github.event_name == 'pull_request'
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
coverage_path: "coverage.xml"
comment: false
comment_context: Coverage PHP ${{ matrix.php }}-${{ matrix.composer_args }}
status_context: Coverage PHP ${{ matrix.php }}-${{ matrix.composer_args }}
threshold_alert: 100
threshold_warning: 100