惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
Martin Fowler
Martin Fowler
博客园_首页
量子位
T
Tailwind CSS Blog
博客园 - Franky
G
Google Developers Blog
D
DataBreaches.Net
Vercel News
Vercel News
B
Blog
Recent Announcements
Recent Announcements
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
爱范儿
爱范儿
博客园 - 【当耐特】
The Cloudflare Blog
H
Help Net Security
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
C
Check Point Blog
有赞技术团队
有赞技术团队
Microsoft Security Blog
Microsoft Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
ci(testbox): add build artifact cache warmup · openclaw/o...
vincentkoc · 2026-04-27 · via Recent Commits to openclaw:main

@@ -0,0 +1,188 @@

1+

name: Blacksmith Build Artifacts Testbox

2+3+

on:

4+

workflow_dispatch:

5+

inputs:

6+

testbox_id:

7+

type: string

8+

description: "Testbox session ID"

9+

required: true

10+

pull_request:

11+

paths:

12+

- ".github/workflows/**"

13+14+

permissions:

15+

contents: read

16+17+

env:

18+

FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

19+20+

jobs:

21+

build-artifacts:

22+

permissions:

23+

contents: read

24+

name: "build-artifacts"

25+

runs-on: blacksmith-8vcpu-ubuntu-2404

26+

timeout-minutes: 35

27+

steps:

28+

- name: Begin Testbox

29+

uses: useblacksmith/begin-testbox@v2

30+

with:

31+

testbox_id: ${{ inputs.testbox_id }}

32+33+

- name: Checkout

34+

shell: bash

35+

env:

36+

CHECKOUT_REPO: ${{ github.repository }}

37+

CHECKOUT_SHA: ${{ github.sha }}

38+

CHECKOUT_TOKEN: ${{ github.token }}

39+

run: |

40+

set -euo pipefail

41+42+

workdir="$GITHUB_WORKSPACE"

43+

auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')"

44+45+

reset_checkout_dir() {

46+

mkdir -p "$workdir"

47+

find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} +

48+

}

49+50+

checkout_attempt() {

51+

local attempt="$1"

52+53+

reset_checkout_dir

54+

git init "$workdir" >/dev/null

55+

git config --global --add safe.directory "$workdir"

56+

git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}"

57+

git -C "$workdir" config gc.auto 0

58+59+

timeout --signal=TERM 30s git -C "$workdir" \

60+

-c protocol.version=2 \

61+

-c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \

62+

fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \

63+

"+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1

64+65+

git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1

66+

test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1

67+

echo "checkout attempt ${attempt}/5 succeeded"

68+

}

69+70+

for attempt in 1 2 3 4 5; do

71+

if checkout_attempt "$attempt"; then

72+

exit 0

73+

fi

74+

echo "checkout attempt ${attempt}/5 failed"

75+

sleep $((attempt * 5))

76+

done

77+78+

echo "checkout failed after 5 attempts" >&2

79+

exit 1

80+81+

- name: Setup Node environment

82+

uses: ./.github/actions/setup-node-env

83+

with:

84+

install-bun: "false"

85+86+

- name: Resolve release dist cache seeds

87+

id: dist-cache-seeds

88+

shell: bash

89+

run: |

90+

set -euo pipefail

91+92+

cache_prefix="${RUNNER_OS}-dist-build-"

93+

declare -A seen=()

94+95+

resolve_tag_sha() {

96+

local tag="$1"

97+

local direct=""

98+

local peeled=""

99+100+

while read -r sha ref; do

101+

if [[ "$ref" == "refs/tags/${tag}^{}" ]]; then

102+

peeled="$sha"

103+

elif [[ "$ref" == "refs/tags/${tag}" ]]; then

104+

direct="$sha"

105+

fi

106+

done < <(git ls-remote --tags origin "refs/tags/${tag}" "refs/tags/${tag}^{}")

107+108+

printf '%s\n' "${peeled:-$direct}"

109+

}

110+111+

{

112+

echo "restore-keys<<EOF"

113+

for dist_tag in beta latest; do

114+

version="$(npm view "openclaw@${dist_tag}" version 2>/dev/null || true)"

115+

if [[ -z "$version" ]]; then

116+

echo "Could not resolve npm dist-tag ${dist_tag}; skipping cache seed." >&2

117+

continue

118+

fi

119+120+

sha="$(resolve_tag_sha "v${version}")"

121+

if [[ -z "$sha" ]]; then

122+

echo "Could not resolve git tag v${version}; skipping cache seed." >&2

123+

continue

124+

fi

125+126+

key="${cache_prefix}${sha}"

127+

if [[ -z "${seen[$key]+x}" ]]; then

128+

echo "$key"

129+

seen[$key]=1

130+

fi

131+

done

132+

echo "${cache_prefix}"

133+

echo "EOF"

134+

} >> "$GITHUB_OUTPUT"

135+136+

- name: Restore dist build cache

137+

id: dist-cache

138+

uses: actions/cache@v5

139+

with:

140+

path: |

141+

.artifacts/build-all-cache/

142+

dist/

143+

dist-runtime/

144+

key: ${{ runner.os }}-dist-build-${{ github.sha }}

145+

restore-keys: ${{ steps.dist-cache-seeds.outputs.restore-keys }}

146+147+

- name: Build dist on cache miss

148+

if: steps.dist-cache.outputs.cache-hit != 'true'

149+

run: pnpm build:ci-artifacts

150+151+

- name: Build Control UI on cache miss

152+

if: steps.dist-cache.outputs.cache-hit != 'true'

153+

run: pnpm ui:build

154+155+

- name: Verify build artifacts

156+

shell: bash

157+

run: |

158+

set -euo pipefail

159+160+

test -d dist

161+

test -d dist-runtime

162+

if [[ ! -f dist/index.js && ! -f dist/index.mjs ]]; then

163+

echo "Missing dist/index.js or dist/index.mjs" >&2

164+

exit 1

165+

fi

166+

test -f dist/build-info.json

167+

test -f dist/control-ui/index.html

168+169+

- name: Prepare Testbox shell

170+

shell: bash

171+

run: |

172+

set -euo pipefail

173+174+

git fetch --no-tags --depth=50 origin "+refs/heads/main:refs/remotes/origin/main"

175+176+

node_bin="$(dirname "$(node -p 'process.execPath')")"

177+

pnpm_bin="$(command -v pnpm)"

178+

sudo ln -sf "$node_bin/node" /usr/local/bin/node

179+

sudo ln -sf "$node_bin/npm" /usr/local/bin/npm

180+

sudo ln -sf "$node_bin/npx" /usr/local/bin/npx

181+

sudo ln -sf "$node_bin/corepack" /usr/local/bin/corepack

182+

sudo ln -sf "$pnpm_bin" /usr/local/bin/pnpm

183+184+

- name: Run Testbox

185+

uses: useblacksmith/run-testbox@v2

186+

if: always()

187+

env:

188+

FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"