88 required : false
99 type : number
1010 default : 80
11+ run-dependencies-check :
12+ description : Whether to run the dependency health check during CI.
13+ required : false
14+ type : boolean
15+ default : true
16+ max-outdated :
17+ description : Maximum number of outdated packages allowed by the dependencies command.
18+ required : false
19+ type : number
20+ default : 5
1121 workflow_dispatch :
1222 inputs :
1323 min-coverage :
1424 description : Minimum line coverage percentage enforced by dev-tools tests.
1525 required : false
1626 type : number
1727 default : 80
28+ run-dependencies-check :
29+ description : Whether to run the dependency health check during CI.
30+ required : false
31+ type : boolean
32+ default : true
33+ max-outdated :
34+ description : Maximum number of outdated packages allowed by the dependencies command.
35+ required : false
36+ type : number
37+ default : 5
1838 pull_request :
1939 paths :
2040 - ' src/**'
@@ -29,8 +49,8 @@ permissions:
2949 contents : read
3050
3151concurrency :
32- group : " pages "
33- cancel-in-progress : false
52+ group : ${{ github.event_name == 'pull_request' && format('tests-pr-{0}', github.event.pull_request.number) || format('tests-{0}', github.ref) }}
53+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
3454
3555jobs :
3656 tests :
3959 strategy :
4060 matrix :
4161 php-version : [ '8.3', '8.4', '8.5' ]
62+ env :
63+ TESTS_ROOT_VERSION : ${{ github.event_name == 'pull_request' && format('dev-{0}', github.event.pull_request.head.ref) || 'dev-main' }}
4264 steps :
4365 - uses : actions/checkout@v6
4466
@@ -64,12 +86,12 @@ jobs:
6486 env :
6587 COMPOSER_AUTH : ' {"github-oauth": {"github.com": "${{ github.token }}"} }'
6688 COMPOSER_CACHE_DIR : /tmp/composer-cache
67- COMPOSER_ROOT_VERSION : dev-main
89+ COMPOSER_ROOT_VERSION : ${{ env.TESTS_ROOT_VERSION }}
6890 run : composer install --prefer-dist --no-progress --no-interaction --no-plugins --no-scripts
6991
7092 - name : Composer Audit
7193 env :
72- COMPOSER_ROOT_VERSION : dev-main
94+ COMPOSER_ROOT_VERSION : ${{ env.TESTS_ROOT_VERSION }}
7395 run : composer audit
7496
7597 - name : Resolve minimum coverage
@@ -80,5 +102,43 @@ jobs:
80102
81103 - name : Run PHPUnit tests
82104 env :
83- COMPOSER_ROOT_VERSION : dev-main
105+ COMPOSER_ROOT_VERSION : ${{ env.TESTS_ROOT_VERSION }}
84106 run : composer dev-tools tests -- --coverage=public/coverage --min-coverage=${{ steps.minimum-coverage.outputs.value }}
107+
108+ dependency-health :
109+ name : Dependency Health
110+ if : ${{ github.event_name != 'workflow_call' || inputs.run-dependencies-check }}
111+ runs-on : ubuntu-latest
112+ continue-on-error : true
113+ env :
114+ TESTS_ROOT_VERSION : ${{ github.event_name == 'pull_request' && format('dev-{0}', github.event.pull_request.head.ref) || 'dev-main' }}
115+ steps :
116+ - uses : actions/checkout@v6
117+
118+ - name : Setup PHP
119+ uses : shivammathur/setup-php@v2
120+ with :
121+ php-version : ' 8.3'
122+
123+ - name : Cache Composer dependencies
124+ uses : actions/cache@v5
125+ with :
126+ path : /tmp/composer-cache
127+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
128+ restore-keys : |
129+ ${{ runner.os }}-composer-
130+
131+ - name : Mark workspace as safe for git
132+ run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
133+
134+ - name : Install dependencies
135+ env :
136+ COMPOSER_AUTH : ' {"github-oauth": {"github.com": "${{ github.token }}"} }'
137+ COMPOSER_CACHE_DIR : /tmp/composer-cache
138+ COMPOSER_ROOT_VERSION : ${{ env.TESTS_ROOT_VERSION }}
139+ run : composer install --prefer-dist --no-progress --no-interaction --no-plugins --no-scripts
140+
141+ - name : Run dependency health check
142+ env :
143+ COMPOSER_ROOT_VERSION : ${{ env.TESTS_ROOT_VERSION }}
144+ run : composer dev-tools dependencies -- --max-outdated=${{ inputs.max-outdated || 5 }}
0 commit comments