Repository navigation
237 lines (237 loc) · 8.48 KB
/
Copy pathci.yml
File metadata and controls
237 lines (237 loc) · 8.48 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
name: checks
on:
push:
branches: [dev, main]
pull_request:
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
jobs:
branch-policy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Test contribution branch policy
run: bash e2e/branch-policy.sh
- name: Check pull request route
if: github.event_name == 'pull_request'
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
BASE_REPOSITORY: ${{ github.repository }}
run: bash scripts/check-branch-policy.sh
agent-adapter:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: scopeweaver_test
POSTGRES_PASSWORD: test_only_password
POSTGRES_DB: scopeweaver_adapter_e2e
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U scopeweaver_test -d scopeweaver_adapter_e2e"
--health-interval 5s --health-timeout 3s --health-retries 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: adapters/agent/package-lock.json
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- run: npm ci
working-directory: adapters/agent
- run: npm test && npm run check
working-directory: adapters/agent
- name: Test adapter against real backend
env:
SCOPEWEAVER_ADAPTER_E2E: "1"
ARTEX_TEST_DSN: postgres://scopeweaver_test:test_only_password@localhost:5432/scopeweaver_adapter_e2e?sslmode=disable
run: go test ./server -run '^TestAgentAdapterE2E$' -count=1 -v
chat-browser:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: scopeweaver_test
POSTGRES_PASSWORD: test_only_password
POSTGRES_DB: scopeweaver_test_chat_browser
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U scopeweaver_test -d scopeweaver_test_chat_browser"
--health-interval 5s --health-timeout 3s --health-retries 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: |
web/package-lock.json
e2e/package-lock.json
- name: Test compaction request attribution
run: node --test e2e/chat-summary-requests.test.mjs
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- run: npm ci
working-directory: web
- run: npm run build:static
working-directory: web
- run: npm ci
working-directory: e2e
- run: npx playwright install --with-deps chromium
working-directory: e2e
- name: Verify draft preservation with a separate disposable database
env:
PGHOST: localhost
PGPORT: "5432"
PGUSER: scopeweaver_test
PGPASSWORD: test_only_password
ARTEX_TEST_DSN: postgres://scopeweaver_test:test_only_password@localhost:5432/scopeweaver_test_chat_draft?sslmode=disable
SCOPEWEAVER_CHAT_E2E: "1"
CHAT_E2E_SUITE: draft
run: |
createdb scopeweaver_test_chat_draft
go test ./server -run '^TestChatControlsE2E$' -count=1 -timeout 12m -v
- name: Verify chat controls, recovery, context and document paste
env:
ARTEX_TEST_DSN: postgres://scopeweaver_test:test_only_password@localhost:5432/scopeweaver_test_chat_browser?sslmode=disable
SCOPEWEAVER_CHAT_E2E: "1"
CHAT_E2E_SUITE: standard
run: go test ./server -run '^TestChatControlsE2E$' -count=1 -timeout 21m -v
- if: always()
uses: actions/upload-artifact@v7
with:
name: chat-browser-results
path: dist/chat-e2e
if-no-files-found: ignore
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- run: npm ci
working-directory: web
- run: npm audit --audit-level=low
working-directory: web
- run: npm test
working-directory: web
- run: npm run build:static
working-directory: web
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Test native six-language Windows launcher
run: node e2e/windows-launcher.mjs
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: npm ci
working-directory: web
- run: npm test
working-directory: web
- name: Test native evidence file commits
run: go test ./evidence -run '^Test(WriteBody|CommitBodyFile)' -count=1 -v
- name: Test native Python and skill paths
run: go test ./server -run '^Test(ExecPython|DetectPython.*|SkillRelPath|SkillFilePathsUseForwardSlashes)$' -count=1 -v
- name: Test native chat attachment copies
run: go test ./server -run '^TestCopyChatAttachments' -count=1 -v
backend:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: scopeweaver_test
POSTGRES_PASSWORD: test_only_password
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U scopeweaver_test -d postgres"
--health-interval 5s --health-timeout 3s --health-retries 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@v7
with:
node-version: "22"
- name: Check shell syntax
run: |
for script in *.sh; do bash -n "$script"; done
sh -n start.sh
- name: Test six-language script messages and isolated launchers
run: node e2e/script-locales.mjs
- name: Test local installer with isolated fixtures
run: bash e2e/install-local.sh
- name: Test Compose credential bootstrap
run: bash e2e/compose-credentials.sh
- name: Test third-party notice packaging and repair guards
run: |
bash e2e/package-notices.sh
python3 -m unittest discover -s e2e -p 'test_release_notices.py' -v
- name: Run all Go packages with separate disposable databases
env:
PGHOST: localhost
PGPORT: "5432"
PGUSER: scopeweaver_test
PGPASSWORD: test_only_password
run: |
set -euo pipefail
psql -d postgres -c 'SELECT 1'
# Initialize the supplementary tables created during normal server startup.
cat > "$RUNNER_TEMP/init-test-db.go" <<'GO'
package main
import (
"log"
"os"
"github.com/Autumn-27/artex/db"
)
func main() {
store, err := db.Open(os.Getenv("ARTEX_PG_DSN"))
if err != nil { log.Fatal(err) }
defer store.Close()
if err := store.EnsureLLMUsageTable(); err != nil { log.Fatal(err) }
if err := store.EnsureLLMRecordsTable(); err != nil { log.Fatal(err) }
}
GO
go build -o "$RUNNER_TEMP/init-test-db" "$RUNNER_TEMP/init-test-db.go"
index=0
status=0
while IFS= read -r package; do
index=$((index + 1))
database="scopeweaver_test_${index}"
createdb "$database"
ARTEX_PG_DSN="postgres://${PGUSER}:${PGPASSWORD}@localhost:5432/${database}?sslmode=disable" "$RUNNER_TEMP/init-test-db"
if ! ARTEX_TEST_DSN="postgres://${PGUSER}:${PGPASSWORD}@localhost:5432/${database}?sslmode=disable" go test -p 1 "$package" -count=1 -v; then
status=1
fi
dropdb --force "$database"
done < <(go list ./...)
exit "$status"