4848 mysql : ${{ matrix.mysql }}
4949 sylius : ${{ matrix.sylius }}
5050 symfony : ${{ matrix.symfony }}
51+ check_service_definitions : yes
5152
5253 static-analysis :
5354 name : Static analysis - PHP ${{ matrix.php || '' }}
@@ -59,27 +60,11 @@ jobs:
5960 steps :
6061 - uses : actions/checkout@v4
6162
62- - name : " Create cache suffix"
63- run : echo "CACHE_KEY=${{ github.run_id }}-${{ runner.os }}-${{ matrix.php }}-${{ matrix.sylius }}-${{ matrix.symfony }}" >> $GITHUB_ENV
64- shell : bash
65-
66- - name : " Cache composer"
67- id : cache-composer-lock
68- uses : actions/cache@v4
63+ - uses : ./.github/actions/composer-cache
6964 with :
70- path : |
71- tests/Application/composer.lock
72- composer.lock
73- tests/Application/vendor/
74- vendor/
75- key : composer-${{ hashFiles('composer.json', 'tests/Application/composer.json') }}-${{ env.CACHE_KEY }}
76-
77- # - uses: ./.github/actions/build
78- # with:
79- # php: ${{ matrix.php }}
80- # mysql: ${{ matrix.mysql }}
81- # sylius: ${{ matrix.sylius }}
82- # symfony: ${{ matrix.symfony }}
65+ php : ${{ matrix.php }}
66+ sylius : ${{ matrix.sylius }}
67+ symfony : ${{ matrix.symfony }}
8368
8469 - name : " PHPStan"
8570 run : vendor/bin/phpstan
@@ -97,27 +82,11 @@ jobs:
9782 steps :
9883 - uses : actions/checkout@v4
9984
100- - name : " Create cache suffix"
101- run : echo "CACHE_KEY=${{ github.run_id }}-${{ runner.os }}-${{ matrix.php }}-${{ matrix.sylius }}-${{ matrix.symfony }}" >> $GITHUB_ENV
102- shell : bash
103-
104- - name : " Cache composer"
105- id : cache-composer-lock
106- uses : actions/cache@v4
85+ - uses : ./.github/actions/composer-cache
10786 with :
108- path : |
109- tests/Application/composer.lock
110- composer.lock
111- tests/Application/vendor/
112- vendor/
113- key : composer-${{ hashFiles('composer.json', 'tests/Application/composer.json') }}-${{ env.CACHE_KEY }}
114-
115- # - uses: ./.github/actions/build
116- # with:
117- # php: ${{ matrix.php }}
118- # mysql: ${{ matrix.mysql }}
119- # sylius: ${{ matrix.sylius }}
120- # symfony: ${{ matrix.symfony }}
87+ php : ${{ matrix.php }}
88+ sylius : ${{ matrix.sylius }}
89+ symfony : ${{ matrix.symfony }}
12190
12291 - run : vendor/bin/phpunit --testsuite unit --exclude-group requires-fixes
12392
@@ -164,41 +133,40 @@ jobs:
164133# if: always()
165134# with:
166135# subject: E2E tests - PHP ${{ matrix.php || '' }}
167- #
168- # api-tests:
169- # name: API tests - PHP ${{ matrix.php || '' }}
170- # needs: [ get-matrix, build ]
171- # runs-on: ubuntu-latest
172- # strategy:
173- # fail-fast: false
174- # matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
175- # env:
176- # DATABASE_URL: "mysql://root:root@127.0.0.1:3306/sylius?serverVersion=${{ matrix.mysql }}"
177- # STATE_MACHINE_DEFAULT_ADAPTER: ${{ matrix.state_machine }}
178- # steps:
179- # - uses: actions/checkout@v4
180- #
181- # - name: "Run Mockoon"
182- # uses: mockoon/cli-action@v2
183- # with:
184- # version: "latest"
185- # data-file: "./tests/mockoon_tpay.json"
186- # port: 4000
187- #
188- # - uses: ./.github/actions/build
189- # with:
190- # php: ${{ matrix.php }}
191- # mysql: ${{ matrix.mysql }}
192- # sylius: ${{ matrix.sylius }}
193- # symfony: ${{ matrix.symfony }}
194- #
195- # - run: vendor/bin/phpunit --testsuite api
196- #
197- # - uses: ./.github/actions/upload-logs
198- # if: always()
199- # with:
200- # subject: API tests - PHP ${{ matrix.php || '' }}
201- #
136+
137+ api-tests :
138+ name : API tests - PHP ${{ matrix.php || '' }}
139+ needs : [ get-matrix, build ]
140+ runs-on : ubuntu-latest
141+ strategy :
142+ fail-fast : false
143+ matrix : ${{ fromJson(needs.get-matrix.outputs.matrix) }}
144+ env :
145+ DATABASE_URL : " mysql://root:root@127.0.0.1:3306/sylius?serverVersion=${{ matrix.mysql }}"
146+ STATE_MACHINE_DEFAULT_ADAPTER : ${{ matrix.state_machine }}
147+ steps :
148+ - uses : actions/checkout@v4
149+
150+ - name : " Run Mockoon"
151+ uses : mockoon/cli-action@v2
152+ with :
153+ version : " latest"
154+ data-file : " ./tests/mockoon_tpay.json"
155+ port : 4000
156+
157+ - uses : ./.github/actions/composer-cache
158+ with :
159+ php : ${{ matrix.php }}
160+ sylius : ${{ matrix.sylius }}
161+ symfony : ${{ matrix.symfony }}
162+
163+ - run : vendor/bin/phpunit --testsuite api
164+
165+ - uses : ./.github/actions/upload-logs
166+ if : always()
167+ with :
168+ subject : API tests - PHP ${{ matrix.php || '' }}
169+
202170 contract-tests :
203171 name : Contract tests - PHP ${{ matrix.php || '' }}
204172 needs : [ get-matrix, build ]
@@ -209,20 +177,11 @@ jobs:
209177 steps :
210178 - uses : actions/checkout@v4
211179
212- - name : " Create cache suffix"
213- run : echo "CACHE_KEY=${{ github.run_id }}-${{ runner.os }}-${{ matrix.php }}-${{ matrix.sylius }}-${{ matrix.symfony }}" >> $GITHUB_ENV
214- shell : bash
215-
216- - name : " Cache composer"
217- id : cache-composer-lock
218- uses : actions/cache@v4
180+ - uses : ./.github/actions/composer-cache
219181 with :
220- path : |
221- tests/Application/composer.lock
222- composer.lock
223- tests/Application/vendor/
224- vendor/
225- key : composer-${{ hashFiles('composer.json', 'tests/Application/composer.json') }}-${{ env.CACHE_KEY }}
182+ php : ${{ matrix.php }}
183+ sylius : ${{ matrix.sylius }}
184+ symfony : ${{ matrix.symfony }}
226185
227186 - run : vendor/bin/phpunit --testsuite contract_external
228187
0 commit comments