File tree Expand file tree Collapse file tree 5 files changed +66
-21
lines changed Expand file tree Collapse file tree 5 files changed +66
-21
lines changed Original file line number Diff line number Diff line change 66
77jobs :
88 publish :
9+ name : Publish Documentation
910 runs-on : ubuntu-latest
1011
11- strategy :
12- matrix :
13- php-version : [ '8.2' ]
14-
1512 steps :
1613 - name : Checkout source code
17- uses : actions/checkout@v2
14+ uses : actions/checkout@v3
15+ with :
16+ fetch-depth : 0
1817
1918 - name : Install PHP
2019 uses : shivammathur/setup-php@v2
2120 with :
22- php-version : ${{ matrix.php-version }}
21+ php-version : ' 8.3 '
2322 extensions : mbstring
2423 coverage : xdebug
2524 tools : composer:v2
2625
2726 - name : Cache dependencies
28- uses : actions/cache@v2
27+ uses : actions/cache@v4.3.0
2928 with :
3029 path : ~/.composer/cache
3130 key : php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
Original file line number Diff line number Diff line change 1+ name : SonarCloud
2+
3+ on :
4+ push :
5+ branches : [ 'main' ]
6+ pull_request :
7+ types : [ 'opened', 'synchronize', 'reopened' ]
8+
9+ jobs :
10+ sonarcloud :
11+ name : SonarCloud Analysis
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout source code
16+ uses : actions/checkout@v3
17+ with :
18+ fetch-depth : 0
19+
20+ - name : Install PHP
21+ uses : shivammathur/setup-php@v2
22+ with :
23+ php-version : ' 8.3'
24+ coverage : xdebug
25+ tools : composer:v2
26+
27+ - name : Cache dependencies
28+ uses : actions/cache@v4.3.0
29+ with :
30+ path : ~/.composer/cache
31+ key : php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
32+ restore-keys : php-${{ matrix.php-version }}-composer-
33+
34+ - name : Validate composer.json and composer.lock
35+ run : composer validate
36+
37+ - name : Install Dependencies
38+ run : composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
39+
40+ - name : Execute Unit, Integration and Acceptance Tests
41+ run : composer test
42+
43+ - name : Fix paths in coverage reports for Sonar
44+ run : |
45+ sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
46+ sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' test.xml
47+
48+ - name : Run SonarCloud Scan
49+ uses : SonarSource/sonarcloud-github-action@v2
50+ with :
51+ projectBaseDir : .
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 88
99jobs :
1010 test :
11+ name : Test on PHP ${{ matrix.php-version }}
1112 runs-on : ubuntu-latest
1213
1314 strategy :
1415 matrix :
15- php-version : [ '8.2', '8.3' ]
16+ php-version : [ '8.2', '8.3', '8.4' ]
1617
1718 steps :
1819 - name : Checkout source code
2829 tools : composer:v2
2930
3031 - name : Cache dependencies
31- uses : actions/cache@v2
32+ uses : actions/cache@v4.3.0
3233 with :
3334 path : ~/.composer/cache
3435 key : php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
3738 - name : Validate composer.json and composer.lock
3839 run : composer validate
3940
40- - name : Install dependencies
41+ - name : Install Dependencies
4142 if : steps.composer-cache.outputs.cache-hit != 'true'
4243 run : composer install --prefer-dist --no-progress --no-suggest
4344
4647
4748 - name : Execute Unit, Integration and Acceptance Tests
4849 run : composer test
49-
50- - name : Fix coverage.xml for Sonar
51- run : |
52- sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
53- sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' test.xml
54-
55- - name : SonarCloud Scan
56- uses : SonarSource/sonarcloud-github-action@master
57- env :
58- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ composer.lock
1111wiki /Home.md
1212/.phpunit.cache
1313.phpactor.json
14+ /.serena /
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ sonar.sources=src
66sonar.tests =tests
77sonar.php.coverage.reportPaths =coverage.xml
88sonar.php.tests.reportPath =test.xml
9+ sonar.branch.name =main
You can’t perform that action at this time.
0 commit comments