-
Notifications
You must be signed in to change notification settings - Fork 407
131 lines (114 loc) · 3.41 KB
/
Copy pathcontrol-plane.yml
File metadata and controls
131 lines (114 loc) · 3.41 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
name: Control Plane CI
on:
pull_request:
paths:
- 'control-plane/**'
- '.github/workflows/control-plane.yml'
push:
branches: [main]
paths:
- 'control-plane/**'
- '.github/workflows/control-plane.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
linux-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.2'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: control-plane/web/client/package-lock.json
- name: Build control plane UI
working-directory: control-plane/web/client
run: |
npm ci
npm run build
- name: Build control plane
working-directory: control-plane
run: GOFLAGS=-buildvcs=false go build ./...
- name: Run tests
working-directory: control-plane
run: go test ./...
- name: Lint
working-directory: control-plane
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run
compile-matrix:
runs-on: ubuntu-latest
needs: linux-tests
strategy:
fail-fast: false
matrix:
goos: [linux, darwin, windows]
goarch: [amd64]
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.2'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-
${{ runner.os }}-go-
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: control-plane/web/client/package-lock.json
- name: Build control plane UI
working-directory: control-plane/web/client
run: |
npm ci
npm run build
- name: Compile control plane binary
working-directory: control-plane
run: |
echo "Building for ${GOOS}/${GOARCH}"
go build -o /tmp/agentfield-server-${GOOS}-${GOARCH} ./cmd/agentfield-server
# Summary job that depends on all critical checks
required-checks:
name: All Required Checks Passed
runs-on: ubuntu-latest
needs: [linux-tests, compile-matrix]
if: always()
steps:
- name: Check all jobs
run: |
if [ "${{ needs.linux-tests.result }}" != "success" ] || [ "${{ needs.compile-matrix.result }}" != "success" ]; then
echo "One or more required checks failed"
exit 1
fi
echo "All required checks passed successfully"