@@ -3,33 +3,47 @@ name: CI
33on :
44 pull_request :
55
6+ concurrency :
7+ group : ci-${{ github.event.pull_request.number }}
8+ cancel-in-progress : true
9+
610permissions :
711 contents : read
812
9- env :
10- PHP_VERSION : ' 8.5'
11-
1213jobs :
14+ resolve-tooling-image :
15+ name : Resolve tooling image
16+ runs-on : ubuntu-latest
17+ timeout-minutes : 5
18+ outputs :
19+ php-image : ${{ steps.config.outputs.php-image }}
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v7
23+
24+ - name : Resolve tooling image from the Makefile
25+ id : config
26+ run : echo "php-image=$(make show-image)" >> "$GITHUB_OUTPUT"
27+
1328 build :
1429 name : Build
30+ needs : resolve-tooling-image
1531 runs-on : ubuntu-latest
16-
32+ timeout-minutes : 15
33+ env :
34+ image : ${{ needs.resolve-tooling-image.outputs.php-image }}
35+ workspace : /var/www/html
1736 steps :
1837 - name : Checkout
1938 uses : actions/checkout@v7
2039
21- - name : Configure PHP
22- uses : shivammathur/setup-php@v2
23- with :
24- php-version : ${{ env.PHP_VERSION }}
25- extensions : bcmath
26- tools : composer:2
27-
2840 - name : Validate composer.json
29- run : composer validate --no-interaction
41+ run : docker run --rm -v "${PWD}":${{ env.workspace }} ${{ env.image }} composer validate --no-interaction
3042
3143 - name : Install dependencies
32- 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
3347
3448 - name : Upload vendor and composer.lock as artifact
3549 uses : actions/upload-artifact@v7
@@ -41,50 +55,36 @@ jobs:
4155
4256 auto-review :
4357 name : Auto review
58+ needs : [resolve-tooling-image, build]
4459 runs-on : ubuntu-latest
45- needs : build
46-
60+ timeout-minutes : 15
4761 steps :
4862 - name : Checkout
4963 uses : actions/checkout@v7
5064
51- - name : Configure PHP
52- uses : shivammathur/setup-php@v2
53- with :
54- php-version : ${{ env.PHP_VERSION }}
55- extensions : bcmath
56- tools : composer:2
57-
5865 - name : Download vendor artifact from build
5966 uses : actions/download-artifact@v8
6067 with :
6168 name : vendor-artifact
6269 path : .
6370
6471 - name : Run review
65- run : composer review
72+ run : make review
6673
6774 tests :
6875 name : Tests
76+ needs : [resolve-tooling-image, auto-review]
6977 runs-on : ubuntu-latest
70- needs : auto-review
71-
78+ timeout-minutes : 15
7279 steps :
7380 - name : Checkout
7481 uses : actions/checkout@v7
7582
76- - name : Configure PHP
77- uses : shivammathur/setup-php@v2
78- with :
79- php-version : ${{ env.PHP_VERSION }}
80- extensions : bcmath
81- tools : composer:2
82-
8383 - name : Download vendor artifact from build
8484 uses : actions/download-artifact@v8
8585 with :
8686 name : vendor-artifact
8787 path : .
8888
8989 - name : Run tests
90- run : composer tests
90+ run : make tests tests-without-bcmath
0 commit comments