Skip to content

Commit 695e721

Browse files
committed
ci: default back to -mod=mod in CI
1 parent 44ceae6 commit 695e721

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
go-version-file: "go.mod"
4747
cache: true
4848

49+
- name: Install dependencies
50+
run: go mod download
51+
4952
- name: Check code formatting
5053
run: make format-ci
5154

@@ -71,6 +74,9 @@ jobs:
7174
go-version-file: "go.mod"
7275
cache: true
7376

77+
- name: Install dependencies
78+
run: go mod download
79+
7480
- name: Build for ${{ matrix.os }}/${{ matrix.arch }}
7581
run: |
7682
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build-ci

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ build: ## Build the agent
128128

129129
.PHONY: test-ci
130130
test-ci: ## Run tests in CI
131-
go test -coverprofile=coverage.out ./...
132-
go tool cover -func=coverage.out
131+
GOFLAGS="" go test -coverprofile=coverage.out ./...
132+
GOFLAGS="" go tool cover -func=coverage.out
133133

134134
.PHONY: format-ci
135135
format-ci: install-gofumpt install-goimports-reviser ## Check code formatting in CI
@@ -150,8 +150,10 @@ format-ci: install-gofumpt install-goimports-reviser ## Check code formatting in
150150
@echo "All files are properly formatted!"
151151

152152
.PHONY: lint-ci
153-
lint-ci: lint ## Run linters in CI (same as lint)
153+
lint-ci: install-golangci-lint ## Run linters in CI
154+
GOFLAGS="" $(GOLANGCI_LINT) run
154155

155156
.PHONY: build-ci
156-
build-ci: build ## Build the MCP server in CI
157+
build-ci: ## Build the MCP server in CI
158+
GOFLAGS="" CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o dist/server cmd/server/main.go
157159

docs/ci-best-practices.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,14 @@ strategy:
6565

6666
**Integration with Makefile:**
6767

68-
- `make test-ci`: Runs tests with coverage output
68+
- `make test-ci`: Runs tests with coverage output (overrides vendor mode)
6969
- `make format-ci`: Checks formatting without modifying files
70-
- `make lint-ci`: Runs linters (delegates to `make lint`)
71-
- `make build-ci`: Cross-platform build validation
70+
- `make lint-ci`: Runs linters (overrides vendor mode)
71+
- `make build-ci`: Cross-platform build validation (overrides vendor mode)
7272

7373
**Environment Variables:**
7474

7575
- `GOOS` and `GOARCH`: Set by matrix for cross-compilation
76-
- `GOFLAGS="-mod=vendor"`: Automatically set via Makefile export
76+
- `GOFLAGS=""`: CI targets override vendor mode to leverage Go module cache
77+
- Local development still uses `GOFLAGS="-mod=vendor"` for offline builds
7778

0 commit comments

Comments
 (0)