Repository navigation
68 lines (60 loc) · 3.58 KB
/
Copy pathpublished-queue.yml
File metadata and controls
68 lines (60 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Published queue consumer
on:
pull_request:
branches: [main]
paths:
- '.github/queue-contention/**'
- '.github/workflows/published-queue.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
published-queue:
# Qualify the image's stock PHP 8.3 without a floating OS migration.
runs-on: ubuntu-24.04
timeout-minutes: 8
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- name: Record the ordinary hosted PHP environment
run: |
php --version
php -r 'echo json_encode(["xdebug_loaded"=>extension_loaded("xdebug"), "xdebug_ini_mode"=>ini_get("xdebug.mode"), "xdebug_environment_mode"=>getenv("XDEBUG_MODE"), "pcntl"=>extension_loaded("pcntl")], JSON_THROW_ON_ERROR), PHP_EOL;'
composer --version
nproc
free -m
php -r 'if (PHP_MAJOR_VERSION !== 8 || PHP_MINOR_VERSION !== 3) { throw new RuntimeException("This cohort requires PHP 8.3."); } echo "SQLite ", (new PDO("sqlite::memory:"))->getAttribute(PDO::ATTR_SERVER_VERSION), PHP_EOL;'
- name: Install the declared published package and framework
run: >-
composer install --working-dir=.github/queue-contention/current
--no-plugins --no-scripts --prefer-dist --no-progress
- name: Verify installed runtime bytes against the immutable release
run: |
manifest=.github/queue-contention/current/composer.json
reference=$(jq -r '.extra["workflow-published-reference"]' "$manifest")
[[ "$reference" =~ ^[0-9a-f]{40}$ ]]
git fetch --no-tags --depth=1 origin "$reference"
mkdir -p build/expected-published
git archive "$reference" src | tar -xf - -C build/expected-published
diff -qr build/expected-published/src .github/queue-contention/current/vendor/durable-workflow/workflow/src
php -r 'require ".github/queue-contention/current/vendor/autoload.php"; $manifest=json_decode(file_get_contents(".github/queue-contention/current/composer.json"), true, flags: JSON_THROW_ON_ERROR); if (Composer\InstalledVersions::getPrettyVersion("durable-workflow/workflow") !== $manifest["require"]["durable-workflow/workflow"] || Composer\InstalledVersions::getReference("durable-workflow/workflow") !== $manifest["extra"]["workflow-published-reference"]) { throw new RuntimeException("Installed package provenance differs."); }'
- name: Execute the original continuous four-worker cohort
id: ordinary
run: |
sudo systemd-run --scope --quiet \
--property=CPUQuota=200% --property=MemoryMax=2G --property=MemorySwapMax=0 \
runuser --user "$(id -un)" -- \
env XDEBUG_MODE=off DW_PROBE_QUEUE_WAKE=true DW_PROBE_CONTINUOUS=true \
DW_QUALIFICATION_AUTOLOAD="$PWD/.github/queue-contention/current/vendor/autoload.php" \
bash .github/queue-contention/current/limited-cohort.sh
- name: Capture one fresh diagnostic original after a cohort failure
if: ${{ failure() && steps.ordinary.outcome == 'failure' }}
run: |
sudo systemd-run --scope --quiet \
--property=CPUQuota=200% --property=MemoryMax=2G --property=MemorySwapMax=0 \
runuser --user "$(id -un)" -- \
env XDEBUG_MODE=off DW_PROBE_QUEUE_WAKE=true DW_PROBE_CONTINUOUS=true \
DW_PROBE_REPAIR_OBSERVATIONS=true \
DW_QUALIFICATION_AUTOLOAD="$PWD/.github/queue-contention/current/vendor/autoload.php" \
bash .github/queue-contention/current/limited-cohort.sh