@@ -5,66 +5,156 @@ on: [push]
55jobs :
66 composer :
77 runs-on : ubuntu-latest
8+ strategy :
9+ matrix :
10+ php : [ 8.1, 8.2, 8.3 ]
811
912 steps :
10- - uses : actions/checkout@v3
13+ - uses : actions/checkout@v4
1114
1215 - name : Cache Composer dependencies
1316 uses : actions/cache@v3
1417 with :
1518 path : /tmp/composer-cache
16- key : ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
19+ key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
1720
18- - name : Composer
21+ - name : Composer install
1922 uses : php-actions/composer@v6
2023 with :
21- php_version : 8.1
24+ php_version : ${{ matrix.php }}
2225
2326 - name : Archive build
2427 run : mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
2528
2629 - name : Upload build archive for test runners
27- uses : actions/upload-artifact@v3
30+ uses : actions/upload-artifact@v4
2831 with :
29- name : build-artifact
32+ name : build-artifact-${{ matrix.php }}
3033 path : /tmp/github-actions
31-
34+ #
3235# phpunit:
3336# runs-on: ubuntu-latest
34- # needs: [composer]
37+ # needs: [ composer ]
38+ # strategy:
39+ # matrix:
40+ # php: [ 8.1, 8.2, 8.3 ]
41+ #
42+ # outputs:
43+ # coverage: ${{ steps.store-coverage.outputs.coverage_text }}
3544#
3645# steps:
37- # - uses: actions/download-artifact@v2
46+ # - uses: actions/download-artifact@v4
3847# with:
39- # name: build-artifact
48+ # name: build-artifact-${{ matrix.php }}
4049# path: /tmp/github-actions
4150#
4251# - name: Extract build archive
4352# run: tar -xvf /tmp/github-actions/build.tar ./
4453#
4554# - name: PHP Unit tests
4655# uses: php-actions/phpunit@v3
56+ # env:
57+ # XDEBUG_MODE: cover
4758# with:
48- # php_version: 8.0
59+ # version: 10
60+ # php_version: ${{ matrix.php }}
4961# php_extensions: xdebug
50- # configuration: test/phpunit/phpunit.xml
51- # bootstrap: vendor/autoload.php
52-
53- phpstan :
54- runs-on : ubuntu-latest
55- needs : [composer]
56-
57- steps :
58- - uses : actions/download-artifact@v3
59- with :
60- name : build-artifact
61- path : /tmp/github-actions
62-
63- - name : Extract build archive
64- run : tar -xvf /tmp/github-actions/build.tar ./
65-
66- - name : PHP Static Analysis
67- uses : php-actions/phpstan@v3
68- with :
69- path : src/
70- php_version : 8.1
62+ # coverage_text: _coverage/coverage.txt
63+ # coverage_clover: _coverage/clover.xml
64+ #
65+ # - name: Store coverage data
66+ # uses: actions/upload-artifact@v4
67+ # with:
68+ # name: code-coverage-${{ matrix.php }}-${{ github.run_number }}
69+ # path: _coverage
70+ #
71+ # coverage:
72+ # runs-on: ubuntu-latest
73+ # needs: [ phpunit ]
74+ # strategy:
75+ # matrix:
76+ # php: [ 8.1, 8.2, 8.3 ]
77+ #
78+ # steps:
79+ # - uses: actions/download-artifact@v4
80+ # with:
81+ # name: code-coverage-${{ matrix.php }}-${{ github.run_number }}
82+ # path: _coverage
83+ #
84+ # - name: Output coverage
85+ # run: cat "_coverage/coverage.txt"
86+ #
87+ # - name: Upload to Codecov
88+ # uses: codecov/codecov-action@v4
89+ # with:
90+ # token: ${{ secrets.CODECOV_TOKEN }}
91+ #
92+ # phpstan:
93+ # runs-on: ubuntu-latest
94+ # needs: [ composer ]
95+ # strategy:
96+ # matrix:
97+ # php: [ 8.1, 8.2, 8.3 ]
98+ #
99+ # steps:
100+ # - uses: actions/download-artifact@v4
101+ # with:
102+ # name: build-artifact-${{ matrix.php }}
103+ # path: /tmp/github-actions
104+ #
105+ # - name: Extract build archive
106+ # run: tar -xvf /tmp/github-actions/build.tar ./
107+ #
108+ # - name: PHP Static Analysis
109+ # uses: php-actions/phpstan@v3
110+ # with:
111+ # php_version: ${{ matrix.php }}
112+ # path: src/
113+ # level: 6
114+ #
115+ # phpmd:
116+ # runs-on: ubuntu-latest
117+ # needs: [ composer ]
118+ # strategy:
119+ # matrix:
120+ # php: [ 8.1, 8.2, 8.3 ]
121+ #
122+ # steps:
123+ # - uses: actions/download-artifact@v4
124+ # with:
125+ # name: build-artifact-${{ matrix.php }}
126+ # path: /tmp/github-actions
127+ #
128+ # - name: Extract build archive
129+ # run: tar -xvf /tmp/github-actions/build.tar ./
130+ #
131+ # - name: PHP Mess Detector
132+ # uses: php-actions/phpmd@v1
133+ # with:
134+ # php_version: ${{ matrix.php }}
135+ # path: src/
136+ # output: text
137+ # ruleset: phpmd.xml
138+ #
139+ # phpcs:
140+ # runs-on: ubuntu-latest
141+ # needs: [ composer ]
142+ # strategy:
143+ # matrix:
144+ # php: [ 8.1, 8.2, 8.3 ]
145+ #
146+ # steps:
147+ # - uses: actions/download-artifact@v4
148+ # with:
149+ # name: build-artifact-${{ matrix.php }}
150+ # path: /tmp/github-actions
151+ #
152+ # - name: Extract build archive
153+ # run: tar -xvf /tmp/github-actions/build.tar ./
154+ #
155+ # - name: PHP Code Sniffer
156+ # uses: php-actions/phpcs@v1
157+ # with:
158+ # php_version: ${{ matrix.php }}
159+ # path: src/
160+ # standard: phpcs.xml
0 commit comments