|
1 | 1 | name: Sonar |
2 | | - |
3 | | -on: |
| 2 | +'on': |
4 | 3 | push: |
5 | | - branches: [ master ] |
| 4 | + branches: |
| 5 | + - main |
6 | 6 | pull_request: |
7 | | - branches: [ master ] |
| 7 | + branches: |
| 8 | + - main |
8 | 9 | schedule: |
9 | | - - cron: "0 16 * * *" |
10 | | - |
| 10 | + - cron: 0 16 * * * |
11 | 11 | jobs: |
12 | 12 | build: |
13 | 13 | runs-on: ubuntu-latest |
14 | | - |
15 | 14 | steps: |
16 | | - - uses: actions/checkout@v2 |
17 | | - - name: Install PHP |
18 | | - uses: shivammathur/setup-php@v2 |
19 | | - with: |
20 | | - php-version: 7.4 |
21 | | - coverage: xdebug |
22 | | - - name: Setup java |
23 | | - uses: actions/setup-java@v1 |
24 | | - with: |
25 | | - java-version: '11' |
26 | | - - name: Install dependencies |
27 | | - run: | |
28 | | - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492.zip |
29 | | - unzip sonar-scanner-cli-3.3.0.1492.zip |
30 | | - composer --no-plugins --no-scripts install |
31 | | - composer --no-plugins --no-scripts dump-autoload -o |
32 | | - vendor/bin/phpunit --configuration ./phpunit.xml --teamcity |
33 | | - - name: Sonar |
34 | | - env: |
35 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
36 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
37 | | - run: | |
38 | | - sonar-scanner-3.3.0.1492/bin/sonar-scanner \ |
39 | | - -Dsonar.projectName=client-encryption-php \ |
40 | | - -Dsonar.projectKey=Mastercard_client-encryption-php \ |
41 | | - -Dsonar.organization=mastercard \ |
42 | | - -Dsonar.sources=./src \ |
43 | | - -Dsonar.tests=./tests \ |
44 | | - -Dsonar.exclusions=**/vendor/**,**/tests/**,**/*.xml \ |
45 | | - -Dsonar.php.tests.reportPath=tests.xml \ |
46 | | - -Dsonar.php.coverage.reportPaths=coverage.xml \ |
47 | | - -Dsonar.host.url=https://sonarcloud.io \ |
48 | | - -Dsonar.login=$SONAR_TOKEN |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - name: Install PHP |
| 17 | + uses: shivammathur/setup-php@v2 |
| 18 | + with: |
| 19 | + php-version: 7.4 |
| 20 | + coverage: xdebug |
| 21 | + - name: Setup java |
| 22 | + uses: actions/setup-java@v1 |
| 23 | + with: |
| 24 | + java-version: '11' |
| 25 | + - name: Install dependencies |
| 26 | + run: > |
| 27 | + wget |
| 28 | + https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492.zip |
| 29 | +
|
| 30 | + unzip sonar-scanner-cli-3.3.0.1492.zip |
| 31 | +
|
| 32 | + composer --no-plugins --no-scripts install |
| 33 | +
|
| 34 | + composer --no-plugins --no-scripts dump-autoload -o |
| 35 | +
|
| 36 | + vendor/bin/phpunit --configuration ./phpunit.xml --teamcity |
| 37 | + - name: Sonar |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' |
| 40 | + SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}' |
| 41 | + run: | |
| 42 | + sonar-scanner-3.3.0.1492/bin/sonar-scanner \ |
| 43 | + -Dsonar.projectName=client-encryption-php \ |
| 44 | + -Dsonar.projectKey=Mastercard_client-encryption-php \ |
| 45 | + -Dsonar.organization=mastercard \ |
| 46 | + -Dsonar.sources=./src \ |
| 47 | + -Dsonar.tests=./tests \ |
| 48 | + -Dsonar.exclusions=**/vendor/**,**/tests/**,**/*.xml \ |
| 49 | + -Dsonar.php.tests.reportPath=tests.xml \ |
| 50 | + -Dsonar.php.coverage.reportPaths=coverage.xml \ |
| 51 | + -Dsonar.host.url=https://sonarcloud.io \ |
| 52 | + -Dsonar.login=$SONAR_TOKEN |
0 commit comments