-
Notifications
You must be signed in to change notification settings - Fork 23
152 lines (122 loc) · 3.79 KB
/
ci.yml
File metadata and controls
152 lines (122 loc) · 3.79 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dolt
run: curl -fsSL -o /tmp/install-dolt.sh https://github.com/dolthub/dolt/releases/latest/download/install.sh && sudo bash /tmp/install-dolt.sh
- name: Configure dolt
run: |
dolt config --global --add user.email "ci@wasteland.dev"
dolt config --global --add user.name "CI"
- name: Install tools
run: make install-tools
- name: Lint
run: make lint
- name: Format
run: make fmt-check
- name: Vet
run: make vet
- name: Test
run: make test-cover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.txt
flags: go
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
web-check:
name: Web Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: cd web && bun install --frozen-lockfile
- name: Typecheck
run: cd web && bun run tsc --noEmit
- name: Lint
run: cd web && bun run biome check src/
- name: Test
run: cd web && bun run vitest run --coverage
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: web/coverage/lcov.info
flags: web
token: ${{ secrets.CODECOV_TOKEN }}
web-e2e:
name: Web E2E
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- uses: oven-sh/setup-bun@v2
- name: Install web deps
run: cd web && bun install --frozen-lockfile
- name: Install Playwright browser
run: cd web && bunx playwright install --with-deps chromium
- name: Run Playwright e2e
run: cd web && bun run test:e2e
audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Go vulnerability check
run: govulncheck ./...
- uses: oven-sh/setup-bun@v2
- name: Install web deps
run: cd web && bun install --frozen-lockfile
- name: Web dependency audit
continue-on-error: true
run: cd web && bun audit
integration-offline:
name: Integration (offline)
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dolt
run: curl -fsSL -o /tmp/install-dolt.sh https://github.com/dolthub/dolt/releases/latest/download/install.sh && sudo bash /tmp/install-dolt.sh
- name: Configure dolt
run: |
dolt config --global --add user.email "ci@wasteland.dev"
dolt config --global --add user.name "CI"
- name: Offline integration tests
run: make test-integration-offline
integration:
name: Integration (DoltHub)
needs: check
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dolt
run: curl -fsSL -o /tmp/install-dolt.sh https://github.com/dolthub/dolt/releases/latest/download/install.sh && sudo bash /tmp/install-dolt.sh
- name: Integration tests
run: make test-integration