Repository navigation
128 lines (121 loc) · 5.14 KB
/
Copy pathread-summary-binary-parity.yml
File metadata and controls
128 lines (121 loc) · 5.14 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Read summary binary parity
on:
pull_request:
branches: [main]
paths:
- "packages/agent/**"
- "packages/coding-agent/**"
- "scripts/prepare-bun-compile-assets.mjs"
- "scripts/qa/read-summary-*.mjs"
- "scripts/qa/fixtures/read-summary-provider.mjs"
- ".github/workflows/read-summary-binary-parity.yml"
push:
branches: [main]
paths:
- packages/agent/**
- packages/coding-agent/**
- scripts/prepare-bun-compile-assets.mjs
- scripts/qa/read-summary-*.mjs
- scripts/qa/fixtures/read-summary-provider.mjs
- .github/workflows/read-summary-binary-parity.yml
# ci-full-label.yml calls this workflow for the run-full-ci label (senpi#3957).
workflow_call:
permissions:
contents: read
concurrency:
# A fixed per-file prefix, then the workflow name (the caller's in a run-full-ci call), so the label run, the PR's own
# run and the label run's other called workflows never cancel each other; main pushes get one group per commit and are
# never cancelled, so every merge keeps its own macOS/Windows parity result (senpi#3957).
group: read-summary-parity-${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
platform-scope:
name: Platform scope
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
pull-requests: read
outputs:
full: ${{ steps.classify.outputs.full }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: |
scripts/ci-platform-scope.mjs
.github/workflows/read-summary-binary-parity.yml
sparse-checkout-cone-mode: false
- name: List the pull request's changed files
if: github.event_name == 'pull_request'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
if gh api --paginate "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files?per_page=100" --jq '.[] | .filename, (.previous_filename // empty)' > "$RUNNER_TEMP/changed-files"; then
echo "CHANGED_FILES=$RUNNER_TEMP/changed-files" >> "$GITHUB_ENV"
else
echo "::warning::could not list the changed files; running the full macOS/Windows set"
fi
- name: Classify
id: classify
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
run: node scripts/ci-platform-scope.mjs classify --event "$EVENT_NAME" --labels "$PR_LABELS" --changed "${CHANGED_FILES:-}" --workflow .github/workflows/read-summary-binary-parity.yml
# Linux on every matching PR; macOS and Windows only when ci-platform-scope.mjs decides the run is full: a push to
# main, the run-full-ci label (ci-full-label.yml) or a platform-specific diff (senpi#3957).
parity:
needs: platform-scope
name: Read binary parity (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(needs.platform-scope.outputs.full == 'true' && '["ubuntu-latest", "macos-latest", "windows-latest"]' || '["ubuntu-latest"]') }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "24"
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: "1.4.4"
- name: Install without hooks or lifecycle scripts
run: bun install --ignore-scripts --frozen-lockfile
env:
HUSKY: "0"
- name: Fetch the existing locked canvas prebuild
working-directory: node_modules/canvas
run: bun ../prebuild-install/bin.js -r napi
- name: Check and build source
run: |
bunx --bun --no-install tsc --noEmit
bun run build:bun
bun scripts/prepare-bun-compile-assets.mjs
- name: Compile the read surface
run: bun scripts/qa/read-summary-build.mjs --out read-parity/senpi
- name: Execute source and relocated binary reads
shell: bash
run: |
binary="$GITHUB_WORKSPACE/read-parity/senpi"
if [[ "$RUNNER_OS" == Windows ]]; then
binary="$(cygpath -w "$binary.exe")"
output="$(cygpath -w "$GITHUB_WORKSPACE/read-parity/smoke.json")"
else
output="$GITHUB_WORKSPACE/read-parity/smoke.json"
fi
bun scripts/qa/read-summary-smoke.mjs --binary "$binary" --out "$output"
- name: Upload real read receipts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: read-binary-parity-${{ matrix.os }}
path: read-parity/**/*.json
if-no-files-found: error
retention-days: 14