-
-
Notifications
You must be signed in to change notification settings - Fork 78
50 lines (41 loc) · 1.39 KB
/
Copy pathsonarcloud.yml
File metadata and controls
50 lines (41 loc) · 1.39 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
name: SonarCloud
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: sonarcloud-${{ github.ref }}
cancel-in-progress: true
jobs:
sonarcloud:
name: SonarCloud Analysis
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.repository == 'XOOPS/XoopsCore26'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
with:
php-version: "8.4"
extensions: intl, mbstring, mysqli
tools: composer
coverage: xdebug
- name: Prepare composer.json
run: cp composer.json.dist composer.json
- name: Install dependencies
run: composer update --prefer-stable --no-interaction --prefer-dist --no-progress
- name: Ensure build directory exists
run: mkdir -p build/logs
- name: Run tests with coverage
run: xoops_lib/vendor/bin/phpunit --colors=always --coverage-clover coverage.clover
- name: SonarCloud Scan
if: env.SONAR_TOKEN != ''
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}