@@ -3,32 +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- tools : composer:2
26-
2740 - name : Validate composer.json
28- run : composer validate --no-interaction
41+ run : docker run --rm -v "${PWD}":${{ env.workspace }} ${{ env.image }} composer validate --no-interaction
2942
3043 - name : Install dependencies
31- 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
3247
3348 - name : Upload vendor and composer.lock as artifact
3449 uses : actions/upload-artifact@v7
@@ -40,48 +55,36 @@ jobs:
4055
4156 auto-review :
4257 name : Auto review
58+ needs : [resolve-tooling-image, build]
4359 runs-on : ubuntu-latest
44- needs : build
45-
60+ timeout-minutes : 15
4661 steps :
4762 - name : Checkout
4863 uses : actions/checkout@v7
4964
50- - name : Configure PHP
51- uses : shivammathur/setup-php@v2
52- with :
53- php-version : ${{ env.PHP_VERSION }}
54- tools : composer:2
55-
5665 - name : Download vendor artifact from build
5766 uses : actions/download-artifact@v8
5867 with :
5968 name : vendor-artifact
6069 path : .
6170
6271 - name : Run review
63- run : composer review
72+ run : make review
6473
6574 tests :
6675 name : Tests
76+ needs : [resolve-tooling-image, auto-review]
6777 runs-on : ubuntu-latest
68- needs : auto-review
69-
78+ timeout-minutes : 15
7079 steps :
7180 - name : Checkout
7281 uses : actions/checkout@v7
7382
74- - name : Configure PHP
75- uses : shivammathur/setup-php@v2
76- with :
77- php-version : ${{ env.PHP_VERSION }}
78- tools : composer:2
79-
8083 - name : Download vendor artifact from build
8184 uses : actions/download-artifact@v8
8285 with :
8386 name : vendor-artifact
8487 path : .
8588
8689 - name : Run tests
87- run : composer tests
90+ run : make tests
0 commit comments