Skip to content

Commit

Permalink
Avoid using go-ext-builder for running Go tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Nov 28, 2023
1 parent 7b135b8 commit 843b2f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Dockerfile.alpine_tester
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM golang:1.21.4-alpine

RUN apk add build-base

# prepare go cache dirs
RUN mkdir -p /.cache/go-build
RUN chmod -R 777 /.cache
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 843b2f4

Please sign in to comment.