-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (135 loc) · 4.66 KB
/
Copy pathci.yml
File metadata and controls
158 lines (135 loc) · 4.66 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
153
154
155
156
157
158
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
permissions:
contents: read
pull-requests: write
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
continue-on-error: true # Advisory only, pre-existing lint debt
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
# Exclude CGO-dependent packages (pkg/data, cmd/data) that require Diagon C++ headers
# Only report new issues to avoid failing on pre-existing lint debt
args: --timeout=5m --new-from-rev=HEAD~1 ./pkg/coordination/... ./pkg/master/... ./pkg/ppl/... ./pkg/wasm/... ./pkg/common/... ./cmd/master/... ./cmd/coordination/... ./examples/...
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.24']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Download dependencies
run: go mod download
- name: Run unit tests
run: |
# Exclude CGO-dependent packages (pkg/data, cmd/data, cmd/test-cluster, test/integration)
# and ANTLR generated code (go vet complains about unreachable code)
PACKAGES=$(go list ./... | grep -v -E 'pkg/data|cmd/data|cmd/test-cluster|cmd/forcemerge|ppl/parser/generated|test/integration')
go test -short -race -coverprofile=coverage.txt -covermode=atomic $PACKAGES
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
flags: unittests
name: codecov-${{ matrix.go-version }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Download dependencies
run: go mod download
- name: Run integration tests
run: |
# Integration tests require Diagon C++ library (imports pkg/data)
# and a running cluster. Skip in standard CI.
echo "Integration tests require Diagon C++ library - skipping in CI"
echo "Run locally with: go test -v -race -timeout 20m ./test/integration/..."
- name: Upload test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-test-logs
path: /tmp/conjugate-test-*
retention-days: 7
build:
name: Build
runs-on: ubuntu-latest
needs: [unit-tests]
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Build binaries
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p dist
# Build master node
go build -ldflags="-s -w" -o dist/conjugate-master-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} ./cmd/master
# Build coordination node
go build -ldflags="-s -w" -o dist/conjugate-coordination-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} ./cmd/coordination
# Data node requires Diagon C++ library (CGO) - built separately via make data
echo "Skipping data node build (requires Diagon C++ library)"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/
retention-days: 30
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [unit-tests, integration-tests]
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.unit-tests.result }}" != "success" ] || [ "${{ needs.integration-tests.result }}" != "success" ]; then
echo "Tests failed"
exit 1
fi
echo "All tests passed"