-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (107 loc) · 3.15 KB
/
Copy pathci.yml
File metadata and controls
114 lines (107 loc) · 3.15 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
name: CI
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: timescale/timescaledb:latest-pg16
env:
POSTGRES_USER: vortex
POSTGRES_PASSWORD: vortex
POSTGRES_DB: vortex
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U vortex"
--health-interval 5s --health-timeout 3s --health-retries 10
redis:
image: redis:7-alpine
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s --health-timeout 3s --health-retries 10
env:
# With these set, the gated integration tests run for real in CI.
VORTEX_TEST_DB: postgres://vortex:vortex@localhost:5432/vortex?sslmode=disable
VORTEX_TEST_REDIS: redis://localhost:6379/0
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
- name: go vet
run: go vet ./...
- name: Test (race + integration)
run: go test -race -count=1 -coverprofile=coverage.out ./...
- name: Coverage summary
run: go tool cover -func=coverage.out | tail -1
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
# Build golangci-lint from source with the repo's Go toolchain. The
# prebuilt release binaries lag the Go version (go.mod targets 1.26), and
# golangci-lint refuses to run when it was built with an older Go.
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
- name: Lint
run: golangci-lint run ./...
frontend:
name: Web typecheck & build
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- run: npm ci
- run: npm run build
images:
runs-on: ubuntu-latest
needs: [test, lint, frontend]
strategy:
matrix:
target: [panel, node]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Build ${{ matrix.target }} image
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile
target: ${{ matrix.target }}
push: false
tags: vortexui/${{ matrix.target }}:ci
cache-from: type=gha
cache-to: type=gha,mode=max
web-image:
name: Build web image
runs-on: ubuntu-latest
needs: [frontend]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: deploy/web.Dockerfile
push: false
tags: vortexui/web:ci
cache-from: type=gha
cache-to: type=gha,mode=max