Repository navigation
113 lines (111 loc) · 4.76 KB
/
Copy pathds-bot-upstream.yml
File metadata and controls
113 lines (111 loc) · 4.76 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
name: Upstream DS Bot runtime
# Verifies the tracked upstream DS Bot (runtime/ds-bot-upstream, pinned in
# runtime/ds-bot-upstream.pin.json) is unmodified, runs its suite with the documented
# test-only lifecycle hook (all assertions retained), on the DSH
# version it pins, and starts as a container whose Bot API answers. No secrets: upstream's
# suite uses its own fake model, and the startup test runs with --network none.
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ds-bot-upstream-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
pin:
name: Pin and vendor tree
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'
- run: node scripts/ds-bot-upstream.mjs check
- run: node --test scripts/ds-bot-upstream.test.mjs
- run: node --test --test-timeout=5000 scripts/upstream-test-clock.test.mjs scripts/upstream-test-cleanup-overlay.test.mjs
upstream-suite:
name: Upstream suite · Node ${{ matrix.node }} · DSH from pin
needs: pin
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
node: ['24', '22']
defaults:
run:
shell: bash
working-directory: runtime/ds-bot-upstream/ds-bot
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node }}
- name: DSH version from the pin
id: pin
working-directory: .
run: |
dsh=$(node -p "require('./runtime/ds-bot-upstream.pin.json').dsh")
# Strict version only (e.g. 0.2.2-rc.1). Pass the pin through an
# env var; do not paste it into the shell script via a workflow expression.
if [[ ! "$dsh" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)*$ ]]; then
echo "invalid DSH version in pin: $dsh"
exit 1
fi
echo "dsh=$dsh" >> "$GITHUB_OUTPUT"
echo "DSH $dsh"
- run: npm ci --no-fund --no-audit
- name: Install the phone link's packages (imported by upstream tests)
run: npm ci --no-fund --no-audit --prefix ../link
- name: Install DSH test harness (version from pin)
# As upstream's CI does: the testkit pins the DSH packages it was built with.
env:
DSH_VERSION: ${{ steps.pin.outputs.dsh }}
run: |
if [[ ! "$DSH_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)*$ ]]; then
echo "invalid DSH version: $DSH_VERSION"
exit 1
fi
npm run harness -- --no-save "@deepseek-ai/dsh@${DSH_VERSION}" "@deepseek-ai/dsh-agent-loop-testkit@${DSH_VERSION}"
- name: Check managed private histories with the native DSH host
working-directory: .
run: node --test runtime/flybot-image/test/native-open-parts.test.mjs
# Upstream's annotation test owns its mock clock. The restart and dedup
# fixtures stop their runtimes before removing their temporary directories.
# Every assertion and vendor byte stays intact; source hashes fail closed.
- name: Full pinned upstream suite with checked fixture lifecycle
run: NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--import=$(realpath ../../../scripts/upstream-test-clock.mjs)" npm test -- --test-concurrency=1
- run: node scripts/build-client.mjs --check
- run: npm run lint
container-smoke:
name: Container startup smoke
needs: pin
runs-on: ubuntu-24.04
timeout-minutes: 25
defaults:
run:
shell: bash
working-directory: runtime/ds-bot-upstream
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '24'
- name: Build the upstream image (DSH version from the pin)
run: |
dsh=$(node -p "require('../ds-bot-upstream.pin.json').dsh")
if [[ ! "$dsh" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)*$ ]]; then
echo "invalid DSH version in pin: $dsh"
exit 1
fi
docker build -f docker/Dockerfile --build-arg "DSH_VERSION=$dsh" -t flybot-workspace-ds-bot:test .
- name: Upstream startup test (dsh web answers, DS Bot API state loads)
run: node docker/test.mjs flybot-workspace-ds-bot:test