Repository navigation
190 lines (182 loc) · 6.25 KB
/
Copy pathnightly.yml
File metadata and controls
190 lines (182 loc) · 6.25 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
# 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: 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
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: 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