1
1
name : ci
2
2
on :
3
- push :
3
+ pull_request :
4
4
branches :
5
+ - develop
5
6
- master
6
- pull_request :
7
+ push :
7
8
branches :
9
+ - develop
8
10
- master
9
11
10
12
jobs :
@@ -18,15 +20,15 @@ jobs:
18
20
- 6379:6379
19
21
strategy :
20
22
matrix :
21
- php-versions : ['7.3', '8.0']
23
+ version : ['7.3', '8.0']
22
24
steps :
23
25
- name : Checkout code
24
26
uses : actions/checkout@v2
25
27
26
28
- name : Setup PHP
27
29
uses : shivammathur/setup-php@v2
28
30
with :
29
- php-version : ${{ matrix.php-versions }}
31
+ php-version : ${{ matrix.version }}
30
32
extensions : mbstring, intl
31
33
ini-values : post_max_size=256M, max_execution_time=180
32
34
coverage : xdebug
37
39
composer update
38
40
composer dumpautoload
39
41
40
- - name : script
42
+ - name : Build
41
43
run : |
42
44
vendor/bin/phpcs --ignore=functions.php --standard=PSR2 src/
43
45
vendor/bin/phpunit -c phpunit.xml.dist -v --testsuite integration
46
+
47
+ sonarqube :
48
+ name : Sonarqube
49
+ runs-on : ubuntu-latest
50
+ steps :
51
+ - name : Checkout code
52
+ uses : actions/checkout@v2
53
+ with :
54
+ fetch-depth : 0
55
+
56
+ - name : SonarQube Scan (Push)
57
+ if : github.event_name == 'push'
58
+ uses : SonarSource/sonarcloud-github-action@v1.5
59
+ env :
60
+ SONAR_TOKEN : ${{ secrets.SONARQUBE_TOKEN }}
61
+ with :
62
+ projectBaseDir : .
63
+ args : >
64
+ -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
65
+ -Dsonar.projectName=${{ github.event.repository.name }}
66
+ -Dsonar.projectKey=splitsoftware_split-sdk-php
67
+ -Dsonar.exclusions="**/tests/**/*.*"
68
+ -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
69
+ -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
70
+
71
+ - name : SonarQube Scan (Pull Request)
72
+ if : github.event_name == 'pull_request'
73
+ uses : SonarSource/sonarcloud-github-action@v1.5
74
+ env :
75
+ SONAR_TOKEN : ${{ secrets.SONARQUBE_TOKEN }}
76
+ with :
77
+ projectBaseDir : .
78
+ args : >
79
+ -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
80
+ -Dsonar.projectName=${{ github.event.repository.name }}
81
+ -Dsonar.projectKey=splitsoftware_split-sdk-php
82
+ -Dsonar.exclusions="**/tests/**/*.*"
83
+ -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
84
+ -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
85
+ -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
86
+ -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
87
+ -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
0 commit comments