-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.33 KB
/
ci.yml
File metadata and controls
54 lines (44 loc) · 1.33 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: xml, libxml
coverage: xdebug
- name: Cache Composer packages
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Run PHPCS
run: ./vendor/bin/phpcs --standard=PSR12 src/
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse src/ --level=5
- name: Run PHPUnit tests with coverage
run: ./vendor/bin/phpunit tests \
--coverage-clover=clover.xml \
--coverage-filter=src \
--bootstrap=vendor/autoload.php
- name: Generate coverage badge
uses: timkrase/phpunit-coverage-badge@v1.2.0
with:
coverage_badge_path: output/coverage.svg
push_badge: true
repo_token: ${{ secrets.GITHUB_TOKEN }}