Commit 0479540 1 parent 2c39428 commit 0479540 Copy full SHA for 0479540
File tree 4 files changed +20
-3
lines changed
4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 44
44
- name : Checkout repository
45
45
uses : actions/checkout@v4
46
46
47
+ - name : Workspace Init
48
+ run : make workspace-init
49
+
47
50
- name : Unit Test
48
51
run : make unit-test
49
52
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ jobs:
122
122
with :
123
123
go-version : ${{ env.DEFAULT_GO_VERSION }}
124
124
- run : |
125
+ make workspace-init
125
126
go mod tidy
126
127
make controller-gen
127
128
IMG=ghcr.io/open-feature/open-feature-operator:${{ needs.release-please.outputs.release_tag_name }} make helm-package
Original file line number Diff line number Diff line change @@ -5,9 +5,6 @@ WORKDIR /workspace
5
5
# Copy the Go Modules manifests
6
6
COPY go.mod go.mod
7
7
COPY go.sum go.sum
8
- # cache deps before building and copying source so that we don't need to re-download as much
9
- # and so that source changes don't invalidate our downloaded layer
10
- RUN go mod download
11
8
12
9
# Copy the go source
13
10
COPY main.go main.go
@@ -16,6 +13,10 @@ COPY webhooks/ webhooks/
16
13
COPY controllers/ controllers/
17
14
COPY common/ common/
18
15
16
+ # cache deps before building and copying source so that we don't need to re-download as much
17
+ # and so that source changes don't invalidate our downloaded layer
18
+ RUN go work init . ./apis && go mod download
19
+
19
20
ARG TARGETOS
20
21
ARG TARGETARCH
21
22
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ CHART_VERSION=v0.5.4# x-release-please-version
11
11
ENVTEST_K8S_VERSION = 1.26.1
12
12
WAIT_TIMEOUT_SECONDS? =60
13
13
14
+ ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
15
+
14
16
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
15
17
ifeq (,$(shell go env GOBIN) )
16
18
GOBIN =$(shell go env GOPATH) /bin
@@ -256,3 +258,13 @@ install-mockgen:
256
258
go install github.com/golang/mock/mockgen@v1.6.0
257
259
mockgen : install-mockgen
258
260
mockgen -source=controllers/common/flagd-injector.go -destination=controllers/common/mock/flagd-injector.go -package=commonmock
261
+
262
+ workspace-init : workspace-clean
263
+ go work init
264
+ $(foreach module, $(ALL_GO_MOD_DIRS ) , go work use $(module ) ;)
265
+
266
+ workspace-update :
267
+ $(foreach module, $(ALL_GO_MOD_DIRS ) , go work use $(module ) ;)
268
+
269
+ workspace-clean :
270
+ rm -rf go.work
You can’t perform that action at this time.
0 commit comments