Skip to content

Commit

Permalink
chore: build umoci directly for tests
Browse files Browse the repository at this point in the history
Instead of using `go get` which now does nothing after moving to 1.22,
or `go install` which fails in github CI, let's just clone and build
umoci ourselves.

Signed-off-by: Michael McCracken <[email protected]>
  • Loading branch information
mikemccracken committed Jan 11, 2025
1 parent 3627cc9 commit be7ad38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ BATS_VERSION := v1.10.0
# OCI registry
ZOT := $(TOOLS_D)/bin/zot
ZOT_VERSION := v2.1.0
UMOCI := $(TOOLS_D)/bin/umoci
UMOCI_VERSION := main

export PATH := $(TOOLS_D)/bin:$(PATH)

Expand Down Expand Up @@ -122,7 +124,7 @@ go-test:
go tool cover -html coverage.txt -o $(HACK_D)/coverage.html

.PHONY: download-tools
download-tools: $(GOLANGCI_LINT) $(REGCLIENT) $(ZOT) $(BATS)
download-tools: $(GOLANGCI_LINT) $(REGCLIENT) $(ZOT) $(BATS) $(UMOCI)

$(GOLANGCI_LINT):
@mkdir -p $(dir $@)
Expand Down Expand Up @@ -160,6 +162,12 @@ $(BATS):
cd bats-core; ./install.sh $(TOOLS_D); cd ..; \
rm -rf bats-core

$(UMOCI):
mkdir -p ${GOPATH}/src/github.com/opencontainers/
git clone https://github.com/opencontainers/umoci.git ${GOPATH}/src/github.com/opencontainers/umoci
cd ${GOPATH}/src/github.com/opencontainers/umoci ; git reset --hard ${UMOCI_VERSION} ; make umoci ; mv umoci $(UMOCI)
$(UMOCI) --version

TEST?=$(patsubst test/%.bats,%,$(wildcard test/*.bats))
PRIVILEGE_LEVEL?=

Expand Down
1 change: 0 additions & 1 deletion install-build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ EOF

installdeps_golang() {
go version
GO111MODULE=off go install github.com/opencontainers/umoci/cmd/umoci
make download-tools
make docker-clone
make go-download
Expand Down

0 comments on commit be7ad38

Please sign in to comment.