Changeset 63438 for trunk/.github/workflows/reusable-phpunit-tests-v3.yml
- Timestamp:
- 09/02/2026 06:21:17 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/reusable-phpunit-tests-v3.yml
r63412 r63438 14 14 type: 'string' 15 15 default: 'ubuntu-24.04' 16 repository: 17 description: 'The repository to check out and test. Defaults to the repository calling this workflow.' 18 required: false 19 type: 'string' 20 default: '' 21 # Also composes the Gutenberg build name, under the producer's constraint: a valid 22 # artifact name, so no slashes and none of : < > | * ? " 23 ref: 24 description: 'The branch, tag, or SHA to check out. Defaults to the ref that triggered the calling workflow.' 25 required: false 26 type: 'string' 27 default: '' 16 28 php: 17 29 description: 'The version of PHP to use, in the format of X.Y' … … 80 92 gutenberg-sha: 81 93 description: 'The immutable Gutenberg source SHA verified by the calling workflow.' 94 required: false 95 type: string 96 default: '' 97 overlay-artifact: 98 description: 'The name of a same-workflow artifact whose contents are unpacked over the checkout. Optional: for callers whose test files are not part of the repository being tested.' 82 99 required: false 83 100 type: string … … 113 130 # 114 131 # Performs the following steps: 132 # - Requires a ref when the caller points at another repository. 115 133 # - Sets environment variables. 116 134 # - Checks out the repository. 135 # - Unpacks the caller-provided overlay artifact over the checkout, if any. 117 136 # - Downloads the prepared Gutenberg build provided by the calling workflow. 118 137 # - Sets up Node.js. … … 141 160 142 161 steps: 162 # `ref` otherwise falls back to checkout's own default, which for another repository is 163 # its default branch: a "WordPress 6.2" job would test trunk and report green. 164 - name: Require a ref when testing another repository 165 if: ${{ inputs.repository != '' && inputs.ref == '' }} 166 run: | 167 echo 'Testing another repository needs an explicit ref.' >&2 168 exit 1 169 170 # `ref` also composes the Gutenberg artifact name, so reject what that name cannot carry 171 # here rather than at a download step the job only reaches minutes later. 172 - name: Require a ref the artifact name accepts 173 if: ${{ inputs.ref != '' }} 174 env: 175 REF: ${{ inputs.ref }} 176 run: | 177 invalid='[/:<>|*?"\]' 178 if [[ "$REF" =~ $invalid ]]; then 179 echo "A ref that names an artifact cannot contain / : < > | * ? \" \\ - received: $REF" >&2 180 exit 1 181 fi 182 143 183 - name: Configure environment variables 144 184 run: | … … 149 189 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 150 190 with: 191 repository: ${{ inputs.repository || github.repository }} 192 ref: ${{ inputs.ref }} 151 193 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 152 194 persist-credentials: false 195 196 # If the caller specifies an overlay artifact then unpack it over the checkout. 197 - name: Download overlay artifact 198 if: inputs.overlay-artifact != '' 199 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 200 with: 201 # Without a run ID, this action reads only from the caller's current workflow run. 202 name: ${{ inputs.overlay-artifact }} 203 path: . 204 digest-mismatch: error 153 205 154 206 # Only WordPress 7.0+ include Gutenberg-maintained assets from a built zip file. … … 157 209 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 158 210 with: 159 name: gutenberg-build 211 # Every branch in a run shares one artifact namespace, so the producer names each 212 # build after the ref it came from. Compose the same name here rather than taking 213 # it as an input: the two sides already agree on `ref`. 214 name: gutenberg-build${{ inputs.ref && format( '-{0}', inputs.ref ) || '' }} 160 215 path: gutenberg 161 216 digest-mismatch: error
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)