-
Notifications
You must be signed in to change notification settings - Fork 28
102 lines (97 loc) · 3.15 KB
/
Copy pathci.yml
File metadata and controls
102 lines (97 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
# Go tests must never depend on live provider credentials. The Postgres
# service is only wired in here so store tests gated on TEST_POSTGRES_DSN
# actually run in CI — a local expendable database, never anything a
# developer relies on.
go:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: antares
POSTGRES_PASSWORD: antares
POSTGRES_DB: antares_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U antares -d antares_test"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
TEST_POSTGRES_DSN: postgres://antares:antares@127.0.0.1:5432/antares_test?sslmode=disable
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
# //go:embed all:dist requires at least one file; dashboard assets are
# gitignored and built separately. A tracked .gitkeep is the placeholder;
# recreate it here so a bare checkout never fails the embed.
- name: Ensure embed placeholder
run: mkdir -p internal/server/dist && touch internal/server/dist/.gitkeep
- name: Test
run: go test ./...
- name: Vet
run: go vet ./...
web:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Tests
run: bun test
- name: Typecheck
run: bun x tsc -b --noEmit
- name: Production build
run: bun run build
# End-to-end dashboard smoke: build the real binary, boot it on an isolated
# temp home with a synthetic password and a loopback provider stub, then
# walk every route in headless Chrome. Uses `google-chrome-stable` as the
# explicit CHROME so smoke.mjs cannot fall back to an unrelated Chromium
# someone installed on the runner.
smoke:
runs-on: ubuntu-latest
needs: [go, web]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install web deps
working-directory: web
run: bun install --frozen-lockfile
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
id: setup-chrome
with:
chrome-version: stable
- name: Smoke
env:
CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}
# `make smoke` builds both bin/antares and bin/smokefixture (the
# shipped release binary is built by plain `make build` and never
# bundles the fixture) then runs scripts/smoke-run.mjs, which owns
# port pick, isolated ANTARES_HOME, provider stub, readiness, and
# cleanup.
run: make smoke