Skip to content

Commit 05af9d8

Browse files
committed
Fixing workflow
1 parent 98fd482 commit 05af9d8

2 files changed

Lines changed: 38 additions & 42 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: ci
22
on:
33
push:
44
branches:
5+
- develop
56
- master
67
pull_request:
78
branches:
9+
- develop
810
- master
911

1012
jobs:
@@ -37,7 +39,42 @@ jobs:
3739
composer update
3840
composer dumpautoload
3941
40-
- name: script
42+
- name: Build
4143
run: |
4244
vendor/bin/phpcs --ignore=functions.php --standard=PSR2 src/
4345
vendor/bin/phpunit -c phpunit.xml.dist -v --testsuite integration
46+
47+
- name: SonarQube Scan (Push)
48+
if: github.event_name == 'push'
49+
uses: SonarSource/sonarcloud-github-action@v1.5
50+
env:
51+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
52+
with:
53+
projectBaseDir: .
54+
args: >
55+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
56+
-Dsonar.projectName=${{ github.event.repository.name }}
57+
-Dsonar.projectKey=${{ github.event.repository.name }}
58+
-Dsonar.sources='./src'
59+
-Dsonar.exclusions='**/tests/**/*.*'
60+
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
61+
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
62+
63+
- name: SonarQube Scan (Pull Request)
64+
if: github.event_name == 'pull_request'
65+
uses: SonarSource/sonarcloud-github-action@v1.5
66+
env:
67+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
68+
with:
69+
projectBaseDir: .
70+
args: >
71+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
72+
-Dsonar.projectName=${{ github.event.repository.name }}
73+
-Dsonar.projectKey=${{ github.event.repository.name }}
74+
-Dsonar.sources='./src'
75+
-Dsonar.exclusions='**/tests/**/*.*'
76+
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
77+
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
78+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
79+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
80+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

sonar-scanner.sh

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)