@@ -11,43 +11,39 @@ permissions:
1111 contents : read
1212
1313jobs :
14- resolve-php-version :
15- name : Resolve PHP version
14+ resolve-tooling-image :
15+ name : Resolve tooling image
1616 runs-on : ubuntu-latest
1717 timeout-minutes : 5
1818 outputs :
19- php-version : ${{ steps.config.outputs.php-version }}
19+ php-image : ${{ steps.config.outputs.php-image }}
2020 steps :
2121 - name : Checkout
2222 uses : actions/checkout@v7
2323
24- - name : Resolve PHP version from composer.json
24+ - name : Resolve tooling image from the Makefile
2525 id : config
26- run : |
27- version=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | head -1)
28- echo "php-version=$version" >> "$GITHUB_OUTPUT"
26+ run : echo "php-image=$(make show-image)" >> "$GITHUB_OUTPUT"
2927
3028 build :
3129 name : Build
32- needs : resolve-php-version
30+ needs : resolve-tooling-image
3331 runs-on : ubuntu-latest
3432 timeout-minutes : 15
33+ env :
34+ image : ${{ needs.resolve-tooling-image.outputs.php-image }}
35+ workspace : /var/www/html
3536 steps :
3637 - name : Checkout
3738 uses : actions/checkout@v7
3839
39- - name : Setup PHP
40- uses : shivammathur/setup-php@v2
41- with :
42- tools : composer:2
43- extensions : bcmath
44- php-version : ${{ needs.resolve-php-version.outputs.php-version }}
45-
4640 - name : Validate composer.json
47- run : composer validate --no-interaction
41+ run : docker run --rm -v "${PWD}":${{ env.workspace }} ${{ env.image }} composer validate --no-interaction
4842
4943 - name : Install dependencies
50- run : composer install --no-progress --optimize-autoloader --prefer-dist --no-interaction
44+ run : >
45+ docker run --rm -v "${PWD}":${{ env.workspace }} ${{ env.image }}
46+ composer install --no-progress --optimize-autoloader --prefer-dist --no-interaction
5147
5248 - name : Upload vendor and composer.lock as artifact
5349 uses : actions/upload-artifact@v7
@@ -59,50 +55,36 @@ jobs:
5955
6056 auto-review :
6157 name : Auto review
62- needs : [resolve-php-version , build]
58+ needs : [resolve-tooling-image , build]
6359 runs-on : ubuntu-latest
6460 timeout-minutes : 15
6561 steps :
6662 - name : Checkout
6763 uses : actions/checkout@v7
6864
69- - name : Setup PHP
70- uses : shivammathur/setup-php@v2
71- with :
72- tools : composer:2
73- extensions : bcmath
74- php-version : ${{ needs.resolve-php-version.outputs.php-version }}
75-
7665 - name : Download vendor artifact from build
7766 uses : actions/download-artifact@v8
7867 with :
7968 name : vendor-artifact
8069 path : .
8170
8271 - name : Run review
83- run : composer review
72+ run : make review
8473
8574 tests :
8675 name : Tests
87- needs : [resolve-php-version , auto-review]
76+ needs : [resolve-tooling-image , auto-review]
8877 runs-on : ubuntu-latest
8978 timeout-minutes : 15
9079 steps :
9180 - name : Checkout
9281 uses : actions/checkout@v7
9382
94- - name : Setup PHP
95- uses : shivammathur/setup-php@v2
96- with :
97- tools : composer:2
98- extensions : bcmath
99- php-version : ${{ needs.resolve-php-version.outputs.php-version }}
100-
10183 - name : Download vendor artifact from build
10284 uses : actions/download-artifact@v8
10385 with :
10486 name : vendor-artifact
10587 path : .
10688
10789 - name : Run tests
108- run : composer tests
90+ run : make tests
0 commit comments