Repository navigation
240 lines (232 loc) · 8.66 KB
/
Copy pathnightly.yml
File metadata and controls
240 lines (232 loc) · 8.66 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# Compatibility matrix behind the slim PR gate (#31): the PR gate ships one job,
# ubuntu · Node 24 · DSH 0.2.1-rc.2. This workflow restores Windows · Node 24 ·
# DSH 0.2.1-rc.2, ubuntu · Node 22 · DSH 0.2.1-rc.2 and ubuntu · Node 24 ·
# DSH 0.2.1-alpha.1 on schedule and dispatch, and supersedes the matrix/compat
# parts of #29. A window in which main had no commits is skipped; a schedule only
# fires on the default branch. macOS runs locally on a Mac with `npm run ci:local`
# (ds-bot/scripts/local-ci.sh), never on a GitHub-hosted runner.
name: Compatibility
on:
schedule:
- cron: "0 16 * * *" # daily 00:00 Asia/Shanghai
- cron: "0 17 * * 6" # weekly Sunday 01:00 Asia/Shanghai
workflow_dispatch:
permissions:
contents: read
concurrency:
group: compat-${{ github.ref }}
cancel-in-progress: false
jobs:
changes:
name: Window check
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
run: ${{ steps.gate.outputs.run }}
steps:
- name: Check out main with full history
if: github.event_name == 'schedule'
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Decide whether the window has commits on main
id: gate
shell: bash
run: |
run=false
since=""
case "${{ github.event.schedule }}" in
"0 16 * * *") since="24 hours ago" ;;
"0 17 * * 6") since="7 days ago" ;;
esac
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
run=true
reason="manual dispatch always runs"
elif [ -n "$since" ] && [ -n "$(git log --since="$since" --pretty=oneline)" ]; then
run=true
reason="main had commits in the last ${since}"
else
reason="main had no commits in the window (since ${since})"
fi
echo "run=$run" >> "$GITHUB_OUTPUT"
{
echo "### Compatibility run decision"
echo ""
echo "- event: \`${{ github.event_name }}\`"
echo "- window: ${since:-n/a (dispatch)}"
echo "- run: \`${run}\`: ${reason}"
} >> "$GITHUB_STEP_SUMMARY"
daily:
name: compat · ${{ matrix.os }} · Node ${{ matrix.node }} · DSH ${{ matrix.dsh }}
needs: changes
if: needs.changes.outputs.run == 'true' && (github.event_name == 'workflow_dispatch' || github.event.schedule == '0 16 * * *')
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, node: 22, dsh: 0.2.1-rc.2 }
- { os: ubuntu-latest, node: 24, dsh: 0.2.1-alpha.1 }
defaults:
run:
shell: bash
working-directory: core
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: core/package-lock.json
- name: npm ci
run: npm ci --no-fund --no-audit
timeout-minutes: 5
- name: Install DSH ${{ matrix.dsh }}
run: npm run harness -- --no-save "@deepseek-ai/dsh@$DSH"
timeout-minutes: 5
env:
DSH: ${{ matrix.dsh }}
- name: Fetch origin/main for arch-docs check
shell: bash
run: |
set -euo pipefail
# `+`: actions/checkout can leave refs/remotes/origin/main ahead of the base fetched here
# (two pushes seconds apart), and an unforced refspec then dies with "! [rejected]
# ... (non-fast-forward)" before lint and the suite ever run (#807).
git fetch --no-tags --depth=1 origin +main:refs/remotes/origin/main
for n in 50 200 1000 5000; do
if git merge-base origin/main HEAD >/dev/null 2>&1; then
break
fi
git fetch --no-tags --deepen="$n" origin main 2>/dev/null || true
git fetch --no-tags --deepen="$n" origin HEAD 2>/dev/null || true
done
if ! git merge-base origin/main HEAD >/dev/null 2>&1; then
git fetch --unshallow 2>/dev/null || git fetch --no-tags origin main
fi
git merge-base origin/main HEAD >/dev/null
git rev-parse --verify 'origin/main^{commit}'
- name: Lint
run: npm run lint
- name: Build (client bundle is up to date)
run: node scripts/build-client.mjs --check
- name: Tests
run: npm test
- name: Plugin lint
working-directory: .
run: node scripts/lint-plugins.mjs
- name: Plugin tests (social)
working-directory: plugins/social
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (tree)
working-directory: plugins/tree
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (timeline)
working-directory: plugins/timeline
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (workflow)
working-directory: plugins/workflow
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (project)
working-directory: plugins/project
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
weekly:
name: compat · ${{ matrix.os }} · Node ${{ matrix.node }} · DSH ${{ matrix.dsh }}
needs: changes
if: needs.changes.outputs.run == 'true' && (github.event_name == 'workflow_dispatch' || github.event.schedule == '0 17 * * 6')
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- { os: windows-latest, node: 24, dsh: 0.2.1-rc.2 }
defaults:
run:
shell: bash
working-directory: core
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: core/package-lock.json
- name: npm ci
run: npm ci --no-fund --no-audit
timeout-minutes: 5
- name: Install DSH ${{ matrix.dsh }}
run: npm run harness -- --no-save "@deepseek-ai/dsh@$DSH"
timeout-minutes: 5
env:
DSH: ${{ matrix.dsh }}
- name: Fetch origin/main for arch-docs check
shell: bash
run: |
set -euo pipefail
# `+`: actions/checkout can leave refs/remotes/origin/main ahead of the base fetched here
# (two pushes seconds apart), and an unforced refspec then dies with "! [rejected]
# ... (non-fast-forward)" before lint and the suite ever run (#807).
git fetch --no-tags --depth=1 origin +main:refs/remotes/origin/main
for n in 50 200 1000 5000; do
if git merge-base origin/main HEAD >/dev/null 2>&1; then
break
fi
git fetch --no-tags --deepen="$n" origin main 2>/dev/null || true
git fetch --no-tags --deepen="$n" origin HEAD 2>/dev/null || true
done
if ! git merge-base origin/main HEAD >/dev/null 2>&1; then
git fetch --unshallow 2>/dev/null || git fetch --no-tags origin main
fi
git merge-base origin/main HEAD >/dev/null
git rev-parse --verify 'origin/main^{commit}'
- name: Lint
run: npm run lint
- name: Build (client bundle is up to date)
run: node scripts/build-client.mjs --check
- name: Tests
run: npm test
- name: Plugin lint
working-directory: .
run: node scripts/lint-plugins.mjs
- name: Plugin tests (social)
working-directory: plugins/social
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (tree)
working-directory: plugins/tree
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (timeline)
working-directory: plugins/timeline
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (workflow)
working-directory: plugins/workflow
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test
- name: Plugin tests (project)
working-directory: plugins/project
env:
DSH_HARNESS: ${{ github.workspace }}/core/dev/harness
run: npm test