forked from jenssegers/model
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (43 loc) · 1.58 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
stability: [prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: pecl
extensions: xdebug
- name: Show php version
run: php -v && composer -V
- name: Debug if needed
run: if [[ "$DEBUG" == "true" ]]; then env; fi
env:
DEBUG: ${{secrets.DEBUG}}
- name: Install dependencies
run: composer install --prefer-source
- name: PHP code standard
run: php vendor/bin/phpcs --standard=phpcs.xml src/ tests/
- name: PHP static analysis
run: php vendor/bin/phpstan analyse
- name: Run unit tests
run: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Run coverage
run: ./vendor/bin/php-coveralls -v
env:
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Show coverage json
run: cat build/logs/coveralls-upload.json