Repository navigation
82 lines (68 loc) · 2.48 KB
/
Copy pathci.yml
File metadata and controls
82 lines (68 loc) · 2.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
# Minimal CI for SamuelClient (ADR-0004 follow-up): build, vet, and test only.
# It never publishes artifacts.
#
# Order matters:
# 1. main.go embeds all:frontend/dist, so a stub dist must exist before
# any Go compilation — `wails generate module` already compiles the
# module, hence the "Stub frontend dist" step below.
# 2. `wails generate module` produces frontend/wailsjs (gitignored), which
# the frontend TypeScript imports.
# 3. `npm run build` produces the real frontend/dist (replacing the stub).
# 4. Only then can `go build/vet/test` compile package main.
# Plain `go build` (no production/webkit tags) compiles through Wails'
# tag-gated stub, so no GTK/WebKit system packages are required here.
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# The frontend consumes the shared @ha/ui design system through a
# `file:` dependency (frontend/package.json -> ../ha-ui), pinned as a
# git submodule at the repo root, so a recursive checkout is all the
# setup the dependency needs — no sibling clones, no host paths.
- name: Checkout
uses: actions/checkout@v7
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.15.0
- name: Stub frontend dist for embed
run: |
mkdir -p frontend/dist
touch frontend/dist/.gitkeep
- name: Generate Wails bindings
run: wails generate module
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
# The frontend type-checks follow @ha/ui imports into its sources, so
# the design system's own dependencies (react types, radix, lucide)
# must be installed as well.
- name: Install @ha/ui dependencies
run: cd ha-ui && npm ci
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Frontend tests
working-directory: frontend
run: npm test
- name: Go build
run: go build ./...
- name: Go vet
run: go vet ./...
- name: Go test
run: go test ./...