1
- name : PHPDrafter test
1
+ name : PHPDrafter tests
2
2
3
3
on :
4
4
push :
@@ -16,58 +16,74 @@ jobs:
16
16
matrix :
17
17
php-versions : ['7.2', '7.3', '7.4']
18
18
steps :
19
- - name : Checkout
20
- uses : actions/checkout@v1
19
+ - name : Checkout
20
+ uses : actions/checkout@v1
21
21
22
- - name : Setup PHP
23
- uses : shivammathur/setup-php@v1
24
- with :
25
- php-version : ${{ matrix.php-versions }}
26
- extensions : curl,json,mbstring,uopz
27
- coverage : pcov
28
- tools : pecl,phpstan,phpunit,cs2pr,phpcs
22
+ - name : Setup PHP
23
+ uses : shivammathur/setup-php@v1
24
+ with :
25
+ php-version : ${{ matrix.php-versions }}
26
+ extensions : curl,json,mbstring,uopz
27
+ coverage : pcov
28
+ tools : pecl,phpstan,phpunit,cs2pr,phpcs
29
29
30
- - name : Get Composer Cache Directory
31
- id : composer-cache
32
- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
30
+ - name : Get Composer Cache Directory
31
+ id : composer-cache
32
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
33
33
34
- - name : Cache dependencies
35
- uses : actions/cache@v1
36
- with :
37
- path : ${{ steps.composer-cache.outputs.dir }}
38
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
39
- restore-keys : ${{ runner.os }}-composer-
34
+ - name : Cache dependencies
35
+ uses : actions/cache@v1
36
+ with :
37
+ path : ${{ steps.composer-cache.outputs.dir }}
38
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
39
+ restore-keys : ${{ runner.os }}-composer-
40
40
41
- - name : Validate composer.json and composer.lock
42
- run : composer validate
41
+ - name : Validate composer.json and composer.lock
42
+ run : composer validate
43
43
44
- - name : Install dependencies
45
- run : composer install --prefer-dist --no-progress --no-suggest
44
+ - name : Install dependencies
45
+ run : composer install --prefer-dist --no-progress --no-suggest
46
46
47
- - name : Run test suite
48
- run : composer run-script test
47
+ - name : Run test suite
48
+ run : composer run-script test
49
49
50
- - name : Setup Problem Matchers for PHPUnit
51
- run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
50
+ - name : Setup Problem Matchers for PHPUnit
51
+ run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
52
52
53
- - name : PHPStan
54
- run : phpstan analyse --level=3 --error-format=checkstyle src/ | cs2pr
53
+ - name : PHPStan
54
+ run : phpstan analyse --level=3 --error-format=checkstyle src/ | cs2pr
55
55
56
- - name : PHPCS
57
- run : phpcs --standard=PSR12 --ignore=\*/Tests/\*,\*Minifier.php --exclude=PSR1.Methods.CamelCapsMethodName,Generic.Files.LineLength src/ | cs2pr
56
+ - name : PHPCS
57
+ run : phpcs --standard=PSR12 --ignore=\*/Tests/\*,\*Minifier.php --exclude=PSR1.Methods.CamelCapsMethodName,Generic.Files.LineLength src/ | cs2pr
58
58
59
- - name : Upload coverage result
60
- uses : actions/upload-artifact@v1
61
- with :
62
- name : coverage
63
- path : coverage.xml
59
+ - name : Upload coverage result
60
+ uses : actions/upload-artifact@v1
61
+ with :
62
+ name : coverage
63
+ path : coverage.xml
64
64
65
65
analytics :
66
66
name : Analytics
67
67
needs : test
68
+ if : success()
68
69
runs-on : ubuntu-latest
69
70
steps :
70
- - name : Code coverage Scan
71
- uses : codecov/codecov-action@v1
72
- with :
73
- token : ${{ secrets.CODECOV_TOKEN }}
71
+ - name : Checkout
72
+ uses : actions/checkout@v1
73
+
74
+ - name : Download coverage
75
+ uses : actions/download-artifact@v1
76
+ with :
77
+ name : coverage
78
+
79
+ - name : Code coverage Scan
80
+ uses : codecov/codecov-action@v1
81
+ with :
82
+ token : ${{ secrets.CODECOV_TOKEN }}
83
+
84
+ - name : SonarCloud Scan
85
+ uses :
sonarsource/[email protected]
86
+ continue-on-error : true
87
+ env :
88
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
0 commit comments