88
99env :
1010 COMPOSER_ROOT_VERSION : 6.0.x-dev
11+ PHP_VERSION : 8.4
1112
1213permissions :
1314 contents : read
@@ -17,16 +18,29 @@ jobs:
1718 name : Coding Guidelines
1819
1920 runs-on : ubuntu-latest
21+ timeout-minutes : 5
2022
2123 steps :
2224 - name : Checkout
23- uses : actions/checkout@v4
25+ uses : actions/checkout@v5
26+ with :
27+ fetch-depth : 1
28+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
29+
30+ - name : Use local branch
31+ shell : bash
32+ run : |
33+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
34+ git branch -D $BRANCH 2>/dev/null || true
35+ git branch $BRANCH HEAD
36+ git checkout $BRANCH
2437
2538 - name : Install PHP
2639 uses : shivammathur/setup-php@v2
2740 with :
28- php-version : 8.3
41+ php-version : ${{ env.PHP_VERSION }}
2942 coverage : none
43+ tools : none
3044
3145 - name : Run PHP-CS-Fixer
3246 run : ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
@@ -35,16 +49,29 @@ jobs:
3549 name : Static Analysis
3650
3751 runs-on : ubuntu-latest
52+ timeout-minutes : 5
3853
3954 steps :
4055 - name : Checkout
41- uses : actions/checkout@v4
56+ uses : actions/checkout@v5
57+ with :
58+ fetch-depth : 1
59+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
60+
61+ - name : Use local branch
62+ shell : bash
63+ run : |
64+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
65+ git branch -D $BRANCH 2>/dev/null || true
66+ git branch $BRANCH HEAD
67+ git checkout $BRANCH
4268
4369 - name : Install PHP
4470 uses : shivammathur/setup-php@v2
4571 with :
46- php-version : 8.3
72+ php-version : ${{ env.PHP_VERSION }}
4773 coverage : none
74+ tools : none
4875
4976 - name : Install dependencies with Composer
5077 run : ./tools/composer update --no-interaction --no-ansi --no-progress
5683 name : Tests
5784
5885 runs-on : ubuntu-latest
86+ timeout-minutes : 5
5987
6088 strategy :
6189 fail-fast : false
@@ -64,22 +92,98 @@ jobs:
6492 - 8.3
6593 - 8.4
6694 - 8.5
95+ - 8.6
6796
6897 steps :
6998 - name : Checkout
70- uses : actions/checkout@v4
99+ uses : actions/checkout@v5
100+ with :
101+ fetch-depth : 1
102+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
103+
104+ - name : Use local branch
105+ shell : bash
106+ run : |
107+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
108+ git branch -D $BRANCH 2>/dev/null || true
109+ git branch $BRANCH HEAD
110+ git checkout $BRANCH
71111
72112 - name : Install PHP with extensions
73113 uses : shivammathur/setup-php@v2
74114 with :
75115 php-version : ${{ matrix.php-version }}
76- coverage : xdebug
116+ coverage : none
117+ tools : none
118+
119+ - name : Get Composer cache directory
120+ id : composer-cache
121+ shell : bash
122+ run : |
123+ echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
124+
125+ - name : Cache Composer cache directory
126+ uses : actions/cache@v4
127+ with :
128+ path : ${{ steps.composer-cache.outputs.dir }}
129+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
130+ restore-keys : ${{ runner.os }}-composer-
77131
78132 - name : Install dependencies with Composer
79133 run : ./tools/composer update --no-ansi --no-interaction --no-progress
80134
81135 - name : Run tests with PHPUnit
82- run : ./vendor/bin/phpunit --log-junit test-results.xml --coverage-clover=code-coverage.xml
136+ run : vendor/bin/phpunit
137+
138+ code-coverage :
139+ name : Code Coverage
140+
141+ needs :
142+ - tests
143+
144+ runs-on : ubuntu-latest
145+ timeout-minutes : 5
146+
147+ steps :
148+ - name : Checkout
149+ uses : actions/checkout@v5
150+ with :
151+ fetch-depth : 1
152+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
153+
154+ - name : Use local branch
155+ shell : bash
156+ run : |
157+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
158+ git branch -D $BRANCH 2>/dev/null || true
159+ git branch $BRANCH HEAD
160+ git checkout $BRANCH
161+
162+ - name : Install PHP with extensions
163+ uses : shivammathur/setup-php@v2
164+ with :
165+ php-version : ${{ matrix.php-version }}
166+ coverage : xdebug
167+ tools : none
168+
169+ - name : Get Composer cache directory
170+ id : composer-cache
171+ shell : bash
172+ run : |
173+ echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
174+
175+ - name : Cache Composer cache directory
176+ uses : actions/cache@v4
177+ with :
178+ path : ${{ steps.composer-cache.outputs.dir }}
179+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
180+ restore-keys : ${{ runner.os }}-composer-
181+
182+ - name : Install dependencies with Composer
183+ run : ./tools/composer update --no-ansi --no-interaction --no-progress
184+
185+ - name : Collect code coverage with PHPUnit
186+ run : vendor/bin/phpunit --log-junit test-results.xml --coverage-openclover=code-coverage.xml
83187
84188 - name : Upload test results to Codecov.io
85189 if : ${{ !cancelled() }}
0 commit comments