-
-
Notifications
You must be signed in to change notification settings - Fork 1
191 lines (183 loc) · 5.69 KB
/
Copy pathci.yml
File metadata and controls
191 lines (183 loc) · 5.69 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
name: CI
on:
push:
pull_request:
permissions:
contents: read
actions: write # required by actions/upload-artifact
# Cancel superseded runs on the same branch/PR.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
core:
name: Core (Go)
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: core
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: core/go.mod
cache-dependency-path: core/go.sum
- name: Verify Go modules
run: |
go mod verify
go mod tidy
git diff --exit-code go.mod go.sum
- name: Check Go formatting
working-directory: ${{ github.workspace }}
run: |
test -z "$(gofmt -l core/ apps/desktop-wails/)"
- name: go vet
run: go vet ./...
- name: go test with race detector
run: go test -race -count=1 ./...
- name: go build
run: go build -o /tmp/agentvault ./cmd/agentvault
- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: agentvault-linux-amd64
path: /tmp/agentvault
if-no-files-found: error
frontends:
name: Frontend (${{ matrix.app }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
app:
- web-local
- browser-extension
- desktop-wails/frontend
defaults:
run:
working-directory: apps/${{ matrix.app }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: apps/${{ matrix.app }}/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type-check and build
run: npm run build
- name: Run tests
run: npm test
- name: Package browser extension
if: matrix.app == 'browser-extension'
working-directory: apps/browser-extension
run: npm run package
- name: Upload browser extension artifact
if: matrix.app == 'browser-extension'
uses: actions/upload-artifact@v4
with:
name: agentvault-browser-extension
path: apps/browser-extension/agentvault-extension-v*.zip
if-no-files-found: error
mobile:
name: Mobile (Expo type-check and bundle)
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: apps/mobile-expo
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: apps/mobile-expo/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type-check
run: npm run typecheck
- name: Run tests
run: npm test
- name: Bundle iOS with Metro
run: npx expo export --platform ios
- name: Bundle Android with Metro
run: npx expo export --platform android
- name: Upload mobile bundles
uses: actions/upload-artifact@v4
with:
name: agentvault-mobile-bundles
path: |
apps/mobile-expo/dist/ios
apps/mobile-expo/dist/android
if-no-files-found: error
desktop:
name: Desktop (Wails build)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: apps/desktop-wails/go.mod
cache-dependency-path: apps/desktop-wails/go.sum
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: apps/desktop-wails/frontend/package-lock.json
- name: Verify Go modules
working-directory: apps/desktop-wails
run: |
go mod verify
go mod tidy
git diff --exit-code go.mod go.sum
- name: Install GTK/WebKit system libraries
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Build frontend (required by //go:embed frontend/dist)
working-directory: apps/desktop-wails/frontend
run: |
npm ci
npm run build
- name: Run frontend tests
working-directory: apps/desktop-wails/frontend
run: npm test
- name: Build desktop app (Go)
working-directory: apps/desktop-wails
# Ubuntu ships webkit2gtk 4.1, so the webkit2_41 build tag is required.
run: go build -tags webkit2_41 ./...
- name: Build desktop Linux binary
working-directory: apps/desktop-wails
run: go build -tags webkit2_41 -o /tmp/agentvault-desktop .
- name: Upload desktop artifact
uses: actions/upload-artifact@v4
with:
name: agentvault-desktop-linux-amd64
path: /tmp/agentvault-desktop
if-no-files-found: error
contract:
name: Contract (shared client types)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install contract package dependencies
run: |
cd packages/contract
npm install --no-save typescript@5.4.5
- name: Install app dependencies for type-check
run: |
(cd apps/web-local && npm ci)
(cd apps/browser-extension && npm ci)
(cd apps/mobile-expo && npm ci)
(cd apps/desktop-wails/frontend && npm ci)
- name: Run contract check
run: make contract-check