From bc17cef74a7054460dee23944d7c285f897d4cac Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Tue, 19 Apr 2022 15:36:34 -0700 Subject: [PATCH] ci: run go unit tests from the dagger plan Signed-off-by: Sam Alba --- Makefile | 6 +++--- ci.cue | 8 +------- pkg/universe.dagger.io/go/image.cue | 6 +++++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index f936b8d8..887dade6 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ install: # Install a dev dagger binary go install -ldflags '-X go.dagger.io/dagger/version.Revision=$(GIT_REVISION)' ./cmd/dagger .PHONY: test -test: # Run all tests - go test -race -v ./... +test: dagger # Run all tests + ./cmd/dagger/dagger do test .PHONY: golint golint: dagger # Go lint @@ -90,4 +90,4 @@ web: # Run the website locally .PHONY: todo todo: # Find all TODO items - grep -r -A 1 "TODO:" $(CURDIR) \ No newline at end of file + grep -r -A 1 "TODO:" $(CURDIR) diff --git a/ci.cue b/ci.cue index 2ac48b1f..b00bf968 100644 --- a/ci.cue +++ b/ci.cue @@ -73,13 +73,7 @@ dagger.#Plan & { source: _source package: "./..." - // FIXME: doesn't work with CGO_ENABLED=0 - // command: flags: "-race": true - - env: { - // FIXME: removing this complains about lack of gcc - CGO_ENABLED: "0" - } + command: flags: "-race": true } lint: { diff --git a/pkg/universe.dagger.io/go/image.cue b/pkg/universe.dagger.io/go/image.cue index d2f2f5bb..132a7684 100644 --- a/pkg/universe.dagger.io/go/image.cue +++ b/pkg/universe.dagger.io/go/image.cue @@ -13,7 +13,11 @@ _#DefaultVersion: "1.18" packages: [pkgName=string]: version: string | *"" // FIXME Remove once golang image include 1.18 *or* go compiler is smart with -buildvcs - packages: git: _ + packages: { + git: _ + // For GCC and other possible build dependencies + "alpine-sdk": _ + } // FIXME Basically a copy of alpine.#Build with a different image // Should we create a special definition?