Changeset 63517
- Timestamp:
- 09/07/2026 04:05:46 PM (2 months ago)
- Location:
- trunk/.github
- Files:
-
- 4 added
- 6 edited
-
actions (added)
-
actions/smoke-check (added)
-
actions/smoke-check/action.yml (added)
-
actions/smoke-check/smoke-check.sh (added)
-
workflows/install-testing.yml (modified) (5 diffs)
-
workflows/reusable-upgrade-testing.yml (modified) (1 diff)
-
workflows/reusable-workflow-lint.yml (modified) (1 diff)
-
workflows/upgrade-develop-testing.yml (modified) (2 diffs)
-
workflows/upgrade-testing.yml (modified) (2 diffs)
-
workflows/workflow-lint.yml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/install-testing.yml
r63396 r63517 13 13 # Always test the workflow after it's updated. 14 14 paths: 15 - '.github/actions/smoke-check/**' 15 16 - '.github/workflows/install-testing.yml' 16 17 - '.version-support-*.json' … … 19 20 # Always test the workflow when changes are suggested. 20 21 paths: 22 - '.github/actions/smoke-check/**' 21 23 - '.version-support-*.json' 22 24 - '.github/workflows/install-testing.yml' … … 61 63 # - Creates a `wp-config.php` file. 62 64 # - Installs WordPress. 65 # - Serves the installed site and confirms it renders. 63 66 install-tests-mysql: 64 67 name: WP ${{ inputs.wp-version || 'nightly' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }} … … 67 70 runs-on: ${{ matrix.os }} 68 71 if: ${{ github.repository == 'WordPress/wordpress-develop' }} 69 timeout-minutes: 1 072 timeout-minutes: 15 70 73 needs: [ build-test-matrix ] 74 75 env: 76 WP_ADMIN_USER: admin 77 WP_ADMIN_PASSWORD: password 71 78 strategy: 72 79 fail-fast: false … … 136 143 137 144 - name: Install WordPress 138 run: wp core ${{ matrix.multisite && 'multisite-install' || 'install' }} --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password --admin_email=me@example.org --skip-email 145 run: | 146 wp core ${{ matrix.multisite && 'multisite-install' || 'install' }} \ 147 --url=http://localhost/ --title="Install Test" --admin_user="${WP_ADMIN_USER}" \ 148 --admin_password="${WP_ADMIN_PASSWORD}" --admin_email=me@example.org --skip-email 149 150 - name: Check out the smoke check action 151 if: ${{ ! matrix.multisite }} 152 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 153 with: 154 path: ci-tools 155 sparse-checkout: .github/actions 156 persist-credentials: false 157 158 - name: Post-install smoke check 159 # A network's domain lives in wp-config.php and the database, not just an option. 160 if: ${{ ! matrix.multisite }} 161 uses: ./ci-tools/.github/actions/smoke-check 162 with: 163 admin-user: ${{ env.WP_ADMIN_USER }} 164 admin-password: ${{ env.WP_ADMIN_PASSWORD }} 139 165 140 166 slack-notifications: -
trunk/.github/workflows/reusable-upgrade-testing.yml
r63447 r63517 142 142 run: wp core version 143 143 144 - name: Check out the smoke check action 145 if: ${{ ! inputs.multisite }} 146 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 147 with: 148 path: ci-tools 149 sparse-checkout: .github/actions 150 persist-credentials: false 151 144 152 - name: Post-upgrade smoke check 145 153 # A network's domain lives in wp-config.php and the database, not just an option. 146 154 if: ${{ ! inputs.multisite }} 147 run: | 148 site_url="http://127.0.0.1:${SITE_PORT}" 149 server_log="${RUNNER_TEMP}/server.log" 150 jar="${RUNNER_TEMP}/cookies.txt" 151 response="${RUNNER_TEMP}/response.txt" 152 code="${RUNNER_TEMP}/http-code.txt" 153 http_code='' 154 155 # Nothing undoes these, so this step stays last. 156 wp option update home "${site_url}" 157 wp option update siteurl "${site_url}" 158 # Both make requests no check asked for, and the update checks call api.wordpress.org. 159 wp config set DISABLE_WP_CRON true --raw 160 wp config set WP_HTTP_BLOCK_EXTERNAL true --raw 161 162 # opcache counts php -S as a web SAPI, so the runner's JIT runs here and segfaults. 163 php -d opcache.jit=disable -S "127.0.0.1:${SITE_PORT}" -t . > "${server_log}" 2>&1 & 164 server_pid=$! 165 166 stop_server() { 167 local status=$? 168 kill "${server_pid}" 2> /dev/null || true 169 wait "${server_pid}" 2> /dev/null || true 170 [ "${status}" -eq 0 ] || cat "${server_log}" || true 171 exit "${status}" 172 } 173 trap stop_server EXIT 174 175 # No connection prints 000 and exits 7, which set -e would take as fatal. 176 deadline=$(( SECONDS + 30 )) 177 while :; do 178 ready_code="$(curl --silent --max-time 5 --output /dev/null --write-out '%{http_code}' "${site_url}/" || true)" 179 [ "${ready_code}" = '000' ] || break 180 [ "${SECONDS}" -lt "${deadline}" ] || { echo '::error::the server never answered'; exit 1; } 181 sleep 1 182 done 183 184 fail() { 185 echo "::error::${1}" 186 tail -n 20 "${response}" 187 exit 1 188 } 189 190 # An HTTP error returns to the caller. No reply at all is fatal. 191 fetch() { 192 local path="${1}" status=0 193 shift 194 : > "${response}" 195 curl --silent --show-error --max-time 30 --output "${response}" \ 196 --write-out '%{http_code}' --cookie "${jar}" --cookie-jar "${jar}" \ 197 "$@" "${site_url}${path}" > "${code}" || status=$? 198 http_code="$(cat "${code}")" 199 [ "${status}" -eq 0 ] || [ "${status}" -eq 22 ] \ 200 || fail "${path} got no reply and curl exited ${status}" 201 return "${status}" 202 } 203 204 check() { 205 local path="${1}" marker status=0 206 shift 207 fetch "${path}" --fail-with-body || status=$? 208 [ "${status}" -eq 0 ] || fail "${path} returned HTTP ${http_code}" 209 for marker in "$@"; do 210 grep -qF -e "${marker}" "${response}" || fail "${path} did not contain: ${marker}" 211 done 212 echo "ok ${path}" 213 } 214 215 version="$(wp core version)" 216 217 # A fatal mid-page still returns 200, so every check also asks for the closing tag. 218 check '/' "content=\"WordPress ${version}\"" 'Hello world!' '</html>' 219 220 fetch '/?rest_route=/' --fail-with-body || fail "/?rest_route=/ returned HTTP ${http_code}" 221 jq -e '.name == "Upgrade Test"' "${response}" > /dev/null \ 222 || fail 'the REST index was not the expected JSON' 223 echo 'ok /?rest_route=/' 224 225 # It prints this for an empty database too, which the checks above rule out. 226 check '/wp-admin/upgrade.php' 'No Update Required' '</html>' 227 228 fetch '/?p=99999999' || true 229 [ "${http_code}" = '404' ] || fail "a missing post returned ${http_code}, expected 404" 230 grep -qF '</html>' "${response}" || fail 'the 404 page was cut short' 231 echo 'ok 404 handling' 232 233 login_status=0 234 fetch '/wp-login.php' --fail-with-body \ 235 --data-urlencode "log=${WP_ADMIN_USER}" --data-urlencode "pwd=${WP_ADMIN_PASSWORD}" || login_status=$? 236 [ "${login_status}" -eq 0 ] || fail "logging in returned HTTP ${http_code}" 237 grep -qF 'wordpress_logged_in_' "${jar}" || fail 'logging in did not set an authentication cookie' 238 echo 'ok login' 239 240 # The admin bar renders only for a logged-in user. 241 check '/wp-admin/' 'id="wpadminbar"' '</html>' 242 243 # Catches a fatal during shutdown. An empty log would let the grep pass silently. 244 [ -s "${server_log}" ] || { echo '::error::the server wrote no log'; exit 1; } 245 if grep -qE 'Fatal error|Uncaught|Segmentation fault' "${server_log}"; then 246 echo '::error::the server logged a fatal error' 247 exit 1 248 fi 249 echo 'ok server log' 250 env: 251 SITE_PORT: 8889 155 uses: ./ci-tools/.github/actions/smoke-check 156 with: 157 admin-user: ${{ env.WP_ADMIN_USER }} 158 admin-password: ${{ env.WP_ADMIN_PASSWORD }} -
trunk/.github/workflows/reusable-workflow-lint.yml
r62936 r63517 29 29 with: 30 30 args: "-color -verbose" 31 32 # actionlint shellchecks inline `run:` blocks, but does not read composite actions. 33 - name: Run shellcheck on composite action scripts 34 run: find .github -path '.github/actions/*' -name '*.sh' -print0 | xargs -0 -r shellcheck 31 35 32 36 # Runs the Zizmor GitHub Action workflow file linter. -
trunk/.github/workflows/upgrade-develop-testing.yml
r63396 r63517 14 14 - 'src/**.php' 15 15 # Confirm any changes to relevant workflow files. 16 - '.github/actions/smoke-check/**' 16 17 - '.github/workflows/upgrade-develop-testing.yml' 17 18 - '.github/workflows/reusable-upgrade-testing.yml' … … 25 26 - 'src/**.php' 26 27 # Confirm any changes to relevant workflow files. 28 - '.github/actions/smoke-check/**' 27 29 - '.github/workflows/upgrade-develop-testing.yml' 28 30 - '.github/workflows/reusable-upgrade-testing.yml' -
trunk/.github/workflows/upgrade-testing.yml
r63437 r63517 10 10 # Always test the workflow after it's updated. 11 11 paths: 12 - '.github/actions/smoke-check/**' 12 13 - '.github/workflows/upgrade-testing.yml' 13 14 - '.github/workflows/reusable-upgrade-testing.yml' … … 18 19 # Always test the workflow when changes are suggested. 19 20 paths: 21 - '.github/actions/smoke-check/**' 20 22 - '.github/workflows/upgrade-testing.yml' 21 23 - '.github/workflows/reusable-upgrade-testing.yml' -
trunk/.github/workflows/workflow-lint.yml
r63396 r63517 9 9 paths: 10 10 # Only run when changes are made to workflow files. 11 - '.github/actions/**' 11 12 - '.github/workflows/**' 12 13 pull_request: … … 16 17 paths: 17 18 # Only run when changes are made to workflow files. 19 - '.github/actions/**' 18 20 - '.github/workflows/**' 19 21 workflow_dispatch:
Note:
See TracChangeset
for help on using the changeset viewer.