-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (49 loc) · 1.81 KB
/
lint.yml
File metadata and controls
58 lines (49 loc) · 1.81 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
name: Lint
# Phase 1: Single Maintainer Governance
# This workflow provides basic linting functionality.
# See CONTRIBUTING.md for governance evolution plan.
on:
push:
branches: [ main, develop, release/*, hotfix/* ]
pull_request:
branches: [ main, develop, release/*, hotfix/* ]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Install dependencies
run: |
go mod download
go mod verify
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Run golangci-lint on workspace modules
run: |
# Run linting on each module in the workspace
for module in cmd/cli cmd/supervisor pkg services/anchor services/clientapi services/core services/mcpserver services/mesh services/queryapi services/security services/serviceapi services/transformation services/unifiedmodel services/webhook; do
if [ -d "$module" ]; then
echo "Linting $module..."
cd "$module"
golangci-lint run --timeout=5m --allow-parallel-runners
cd - > /dev/null
fi
done
- name: Check formatting
run: |
# Check if code is properly formatted
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted. Please run 'go fmt ./...'"
gofmt -s -l .
exit 1
fi
- name: Run go vet
run: go vet ./...