Skip to content

Commit 99e1931

Browse files
author
janvt
authored
chore(ci): Sonar (#31)
* adjust tests job and add Sonar * highly confusing version juggling * set PHP version * stricter versions
1 parent 437b79a commit 99e1931

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

.github/workflows/test.yml

+27-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
name: Tests
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
412

513
jobs:
614
unit-test:
715
runs-on: ubuntu-latest
816
steps:
9-
- uses: actions/checkout@v3
10-
- uses: php-actions/composer@v6
11-
- name: PHPUnit Tests
12-
uses: php-actions/phpunit@v9
13-
with:
14-
configuration: tests/phpunit.xml
17+
- uses: actions/checkout@v3
18+
- uses: php-actions/composer@v6
19+
- name: PHPUnit Tests
20+
uses: php-actions/phpunit@v3
21+
with:
22+
version: 9.6.5
23+
php_version: 8.2.3
24+
configuration: phpunit.xml
25+
php_extensions: "xdebug"
26+
coverage-text: true
27+
coverage-clover: reports/coverage.xml
28+
29+
# SonarCloud
30+
- name: SonarCloud Scan
31+
uses: SonarSource/sonarcloud-github-action@master
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sonar.projectKey=geekcell_ddd-symfony-bundle
2+
sonar.organization=geekcell
3+
4+
sonar.sources=src
5+
sonar.exclusions=tests/**
6+
sonar.tests=tests
7+
sonar.php.coverage.reportPaths=reports/coverage.xml

0 commit comments

Comments
 (0)