From 7a0a55a34e02ca9fa224cc2c20e039f67e9f35e1 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 27 Nov 2023 21:57:39 +0100 Subject: [PATCH] Avoid using go-ext-builder for running Go tests --- Dockerfile.alpine_tester | 3 +++ Makefile | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.alpine_tester diff --git a/Dockerfile.alpine_tester b/Dockerfile.alpine_tester new file mode 100644 index 000000000..f751a7269 --- /dev/null +++ b/Dockerfile.alpine_tester @@ -0,0 +1,3 @@ +FROM golang:1.21.4-alpine + +RUN apk add build-base diff --git a/Makefile b/Makefile index 8fda39f48..bd4147992 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ # Builds the Rust library libwasmvm BUILDERS_PREFIX := cosmwasm/go-ext-builder:0017 -# Contains a full Go dev environment in order to run Go tests on the built library -ALPINE_TESTER := cosmwasm/go-ext-builder:0017-alpine +# Contains a full Go dev environment including CGO support in order to run Go tests on the built shared library +# This image is currently not published. +ALPINE_TESTER := cosmwasm/alpine-tester:local USER_ID := $(shell id -u) USER_GROUP = $(shell id -g) @@ -123,7 +124,11 @@ release-build: make release-build-macos make release-build-windows -test-alpine: release-build-alpine +.PHONY: create-tester-image +create-tester-image: + docker build -t $(ALPINE_TESTER) - < ./Dockerfile.alpine_tester + +test-alpine: release-build-alpine create-tester-image # try running go tests using this lib with muslc docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/mnt/testrun -w /mnt/testrun $(ALPINE_TESTER) go build -tags muslc ./... # Use package list mode to include all subdirectores. The -count=1 turns off caching.