-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 1.96 KB
/
build.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
on: [push, pull_request]
name: CI
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: composer install
- name: Run PhpStan
run: composer phpstan
- name: Run PhpCs
run: composer phpcs
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: composer install
- name: Run tests
run: composer phpunit-clover
- name: Save logs
uses: actions/upload-artifact@v2
with:
name: logs
path: build/logs
sonarcloud:
needs: [phpunit]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Load logs
uses: actions/download-artifact@v2
with:
name: logs
path: build/logs
- name: Fix phpunit logs
run: |
sed -i 's/\/home\/runner\/work\/regex-dependency\/regex-dependency\///' build/logs/clover.xml
sed -i 's/\/home\/runner\/work\/regex-dependency\/regex-dependency\///' build/logs/phpunit.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=fresh-advance
-Dsonar.projectKey=Fresh-Advance_regex-dependency
-Dsonar.projectName=RegexDependency
-Dsonar.projectVersion=0.3
-Dsonar.sources=Source
-Dsonar.tests=Tests
-Dsonar.sourceEncoding=UTF-8
-Dsonar.php.coverage.reportPaths=build/logs/clover.xml
-Dsonar.php.tests.reportPath=build/logs/phpunit.xml
-Dsonar.cpd.php.minimumTokens=10
-Dsonar.cpd.php.minimumLines=5