-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (52 loc) · 1.88 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
57
58
59
60
61
62
name: CI+
on:
push:
branches:
- '**' # matches every branch
pull_request:
branches:
- master
- dev
- main
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
steps:
- name: Setup PHP (PHP ${{ matrix.php }})
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath
coverage: xdebug
tools: composer
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Composer dependencies
run: composer install
- name: Prepare PHPUnit config file for PHP < 8
run: cp phpunit.xml.dist8 phpunit.xml.dist
if: "matrix.php < 8"
- name: PHPUnit tests (PHP ${{ matrix.php }})
run: php${{ matrix.php }} ./vendor/bin/phpunit --testdox --verbose --stop-on-failure
- uses: symfonycorp/security-checker-action@v3
- name: Coding standard (PHP ${{ matrix.php }})
run: php${{ matrix.php }} ./vendor/bin/ecs check src tests
- name: Code coverage
run: php${{ matrix.php }} -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=var/coverage.xml
- name: Fix code coverage paths
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' var/coverage.xml
# - name: Analyze with SonarQube
# uses: sonarsource/sonarqube-scan-action@master
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# # If you wish to fail your job when the Quality Gate is red, uncomment the
# # following lines. This would typically be used to fail a deployment.
# # - uses: sonarsource/sonarqube-quality-gate-action@master
# # timeout-minutes: 5
# # env:
# # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}