Repository navigation
192 lines (185 loc) · 9.3 KB
/
Copy pathplugin-platforms.yml
File metadata and controls
192 lines (185 loc) · 9.3 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: plugin platforms
# The Claude Code and Codex plugins run inside the user's agent, on the
# user's OS: Claude Code spawns `node` for each hook with no shell; Codex's
# hooks go through a shell (sh, cmd.exe) and bin/loom-node. Each job runs
# the plugin suite, then one real session per agent with the plugin
# installed from this checkout (tests/e2e/agent-session.mjs: a local fake
# answers the model API and Loom, so no provider is called).
# release/** too: a supported line's patches get the same checks.
on:
push:
branches: [main, "release/**"]
paths:
- "integrations/**"
- ".claude-plugin/**"
- ".agents/plugins/**"
- ".gitattributes"
- ".github/workflows/plugin-platforms.yml"
- ".github/agent-clis/**"
- "scripts/code-toolchains/bind-native.cjs"
pull_request:
branches: [main, "release/**"]
paths:
- "integrations/**"
- ".claude-plugin/**"
- ".agents/plugins/**"
- ".gitattributes"
- ".github/workflows/plugin-platforms.yml"
- ".github/agent-clis/**"
- "scripts/code-toolchains/bind-native.cjs"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
NODE_VERSION: "22"
jobs:
platform:
name: plugins on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel, windows-latest, windows-11-arm]
runs-on: ${{ matrix.os }}
timeout-minutes: 25
defaults:
run:
shell: bash
steps:
# Git for Windows checks text files out with CRLF unless told
# otherwise, and a plugin marketplace is a git clone: check out the
# way a Windows user's clone is.
- name: check out with Git for Windows' line endings
if: runner.os == 'Windows'
run: git config --global core.autocrlf true
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: node --test (plugin suite)
run: node --test integrations/claude-code-plugin/tests/*.test.mjs
- name: node --test (grep shim)
if: ${{ !cancelled() }}
run: node --test integrations/grep-shim/tests/*.test.mjs
# The sessions run whatever the suites said: each step is its own signal.
- name: install the agent CLIs
if: ${{ !cancelled() }}
run: |
npm ci --prefix .github/agent-clis --ignore-scripts --no-fund --no-audit
node scripts/code-toolchains/bind-native.cjs .github/agent-clis claude
root=$(npm root --prefix .github/agent-clis)
exe=''
if [ "$RUNNER_OS" = Windows ]; then root=$(cygpath -m "$root"); exe=.exe; fi
codex=$(ls "$root"/@openai/codex-*/vendor/*/bin/codex$exe | head -1)
test -n "$codex" && test -x "$codex" || { echo "The locked native agent executable is missing" >&2; exit 1; }
echo "CLAUDE_BIN=$root/@anthropic-ai/claude-code/bin/claude.exe" >> "$GITHUB_ENV"
echo "CODEX_BIN=$codex" >> "$GITHUB_ENV"
- name: Claude Code session
if: ${{ !cancelled() }}
run: node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin "$CLAUDE_BIN" --expect-tool Bash
- name: Codex session
if: ${{ !cancelled() }}
run: node integrations/claude-code-plugin/tests/e2e/agent-session.mjs codex --bin "$CODEX_BIN"
# Started from the Dock or a desktop launcher, the agent has no node on
# PATH: Claude Code gets it from PATH in its settings env, Codex's
# launcher finds it under a version manager.
- name: Claude Code session, node off PATH
if: ${{ !cancelled() && runner.os != 'Windows' }}
run: node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin "$CLAUDE_BIN" --expect-tool Bash --node-off-path
- name: Codex session, node off PATH
if: ${{ !cancelled() && runner.os != 'Windows' }}
run: node integrations/claude-code-plugin/tests/e2e/agent-session.mjs codex --bin "$CODEX_BIN" --node-off-path
# With no node anywhere, every Claude Code hook fails without blocking
# the turn.
- name: Claude Code session, no node
if: ${{ !cancelled() }}
run: node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin "$CLAUDE_BIN" --expect-tool Bash --no-node
# Without Git Bash, Claude Code's shell tool is PowerShell; the hooks
# still run with no shell. Last step: it moves Git for Windows away.
- name: Claude Code session, no Git Bash
if: ${{ !cancelled() && runner.os == 'Windows' }}
shell: pwsh
run: |
Rename-Item "$env:ProgramFiles\Git" "Git-hidden"
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -notmatch '\\Git\\' }) -join ';'
node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin "$env:CLAUDE_BIN" --expect-tool PowerShell
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin "$env:CLAUDE_BIN" --expect-tool PowerShell --no-node
# musl and BusyBox sh, where agents run in containers. JavaScript actions
# do not run inside an Alpine container, so the job runs one itself.
alpine:
name: plugins on Alpine (musl, BusyBox sh)
runs-on: ubuntu-latest
timeout-minutes: 25
env:
# node:22-alpine, pinned by digest like the rest of CI's third-party code.
ALPINE_IMAGE: node:22-alpine@sha256:0e1754758c2df4cfa3e68d59e2e1b7374bb7fd9ea6328eaaacf15cc934af8202
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# bash is for Claude Code's own shell tool; the hooks run under BusyBox sh.
- name: suite and sessions in node:22-alpine
run: |
docker run --rm -v "$PWD:/src:ro" "$ALPINE_IMAGE" sh -euc '
apk add --quiet git bash
cp -r /src /tmp/repo && chown -R node /tmp/repo
npm ci --prefix /tmp/repo/.github/agent-clis --ignore-scripts --no-fund --no-audit >/dev/null
node /tmp/repo/scripts/code-toolchains/bind-native.cjs /tmp/repo/.github/agent-clis claude
root=$(npm root --prefix /tmp/repo/.github/agent-clis)
codex=$(ls "$root"/@openai/codex-linux-*/vendor/*/bin/codex | head -1)
test -n "$codex" && test -x "$codex" || { echo "The locked native agent executable is missing" >&2; exit 1; }
su node -s /bin/sh -c "
set -e
cd /tmp/repo
git config --global user.email ci@example.com
git config --global user.name ci
node --test integrations/claude-code-plugin/tests/*.test.mjs
node --test integrations/grep-shim/tests/*.test.mjs
node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin $root/@anthropic-ai/claude-code/bin/claude.exe --expect-tool Bash
node integrations/claude-code-plugin/tests/e2e/agent-session.mjs codex --bin $codex
"
'
# WSL 2 runs the Linux build in a Linux kernel under Windows; its PATH also
# carries Windows directories. Node 18 from Ubuntu's archive: the oldest the
# plugins support.
wsl:
name: plugins on WSL 2 (Ubuntu 24.04, Node 18)
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: wsl-bash {0}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: Vampire/setup-wsl@4c48163d9f981914dd8caa0fc335fe19cca5bff4 # v7.2.0
with:
distribution: Ubuntu-24.04
additional-packages: git ca-certificates nodejs npm
- name: suite and sessions in WSL
run: |
useradd -m ci
# A clone inside WSL, with Linux modes and line endings, as a WSL user's is.
git -c safe.directory='*' clone --quiet --no-local . /home/ci/repo
chown -R ci /home/ci/repo
npm ci --prefix /home/ci/repo/.github/agent-clis --ignore-scripts --no-fund --no-audit >/dev/null
node /home/ci/repo/scripts/code-toolchains/bind-native.cjs /home/ci/repo/.github/agent-clis claude
root=$(npm root --prefix /home/ci/repo/.github/agent-clis)
codex=$(ls "$root"/@openai/codex-linux-*/vendor/*/bin/codex | head -1)
test -n "$codex" && test -x "$codex" || { echo "The locked native agent executable is missing" >&2; exit 1; }
su ci -s /bin/sh -c "
set -e
cd /home/ci/repo
node --version
git config --global user.email ci@example.com
git config --global user.name ci
node --test integrations/claude-code-plugin/tests/*.test.mjs
node --test integrations/grep-shim/tests/*.test.mjs
node integrations/claude-code-plugin/tests/e2e/agent-session.mjs claude --bin $root/@anthropic-ai/claude-code/bin/claude.exe --expect-tool Bash
node integrations/claude-code-plugin/tests/e2e/agent-session.mjs codex --bin $codex
"