diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index cb88550..948e407 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -12,7 +12,8 @@ steps: key: "generate" plugins: - docker#v5.11.0: - image: "ghcr.io/theopenlane/build-image:v0.1.2" + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true command: ["task", "ci"] environment: - "GOTOOLCHAIN=auto" @@ -20,7 +21,8 @@ steps: key: "generate_config" plugins: - docker#v5.11.0: - image: "ghcr.io/theopenlane/build-image:v0.1.2" + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true command: ["task", "config:ci"] environment: - "GOTOOLCHAIN=auto" @@ -32,8 +34,9 @@ steps: key: "lint" plugins: - docker#v5.11.0: - image: "golangci-lint:latest-alpine" - command: ["golangci-lint", "run", "-v"] + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true + command: ["task", "go:lint"] always-pull: true environment: - "GOTOOLCHAIN=auto" @@ -43,8 +46,9 @@ steps: TEST_DB_URL: "libsql://file::memory:?cache=shared" plugins: - docker#v5.11.0: - image: golang:1.23.0 - command: ["go", "test", "-coverprofile=coverage.out", "./..."] + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true + command: ["task", "go:test:cover"] environment: - "TEST_DB_URL" artifact_paths: ["coverage.out"] @@ -58,8 +62,9 @@ steps: - "sqlite://file:ent?mode=memory&cache=shared" plugins: - docker#v5.11.0: - image: golang:1.23.0 - command: ["go", "test", "-coverprofile=coverage.out", "./..."] + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true + command: ["task", "go:test:cover"] environment: - "TEST_DB_URL" - "TEST_DB_CONTAINER_EXPIRY=8" # container expiry in minutes @@ -120,21 +125,23 @@ steps: artifact_paths: "bin/${APP_NAME}" plugins: - docker#v5.11.0: - image: "golang:1.23.0" + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true + command: ["task", "go:build"] environment: - CGO_ENABLED=0 - GOOS=linux - command: ["go", "build", "-buildvcs=false", "-mod=mod", "-a", "-o", "bin/$APP_NAME"] - label: ":terminal: build cli" key: "gobuild-cli" artifact_paths: "bin/${APP_NAME}-cli" plugins: - docker#v5.11.0: - image: "golang:1.23.0" + image: "ghcr.io/theopenlane/build-image:latest" + always-pull: true + command: ["task", "go:build-cli"] environment: - GOOS=darwin - GOARCH=arm64 - command: ["go", "build", "-buildvcs=false", "-mod=mod", "-a", "-o", "bin/${APP_NAME}-cli", "./cmd/cli"] - group: ":docker: Image Build" depends_on: "go-builds" key: "image-build" diff --git a/Taskfile.yaml b/Taskfile.yaml index 1def5ae..a531a3c 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -23,6 +23,7 @@ env: TEST_FGA_URL: "localhost:8080" ENV: config GODEBUG: gotypesalias=0 # remove once the backport fixes the types.Alias bug + GOFLAGS: -buildvcs=false tasks: install: @@ -60,6 +61,12 @@ tasks: aliases: [cover] cmds: - go test -v ./... -coverprofile=coverage.out + + go:test:cover:out: + desc: runs and outputs results of created go tests with coverage + aliases: [cover] + cmds: + - task: go:test:cover - go tool cover -html=coverage.out go:fmt: diff --git a/go.mod b/go.mod index 8dc7f0c..c3a4c89 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/theopenlane/dbx -go 1.23.0 +go 1.23.1 require ( ariga.io/entcache v0.1.0 @@ -30,7 +30,7 @@ require ( github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 github.com/theopenlane/beacon v0.1.0 - github.com/theopenlane/core v0.1.8 + github.com/theopenlane/core v0.1.9 github.com/theopenlane/echo-prometheus v0.1.0 github.com/theopenlane/echox v0.1.0 github.com/theopenlane/echozap v0.1.0 diff --git a/go.sum b/go.sum index c938bd4..1eac41c 100644 --- a/go.sum +++ b/go.sum @@ -424,8 +424,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/theopenlane/beacon v0.1.0 h1:cyGx18rbaJTZT8pRcqMMvg+kN6uh86X4OoDahQp6VnE= github.com/theopenlane/beacon v0.1.0/go.mod h1:gOJAanQzfmDF3FIyv7Lwx16bKI7YPkJx1iRT4SdcBW4= -github.com/theopenlane/core v0.1.8 h1:Y0ak+RV9y6hKhXPUoamwtgiobWbB20I+r0t34JA2X5s= -github.com/theopenlane/core v0.1.8/go.mod h1:MaKjCxa3jgrGdv1xWu99npJRWUcvFvBiyWCq8wsLER0= +github.com/theopenlane/core v0.1.9 h1:1D34xKoqKMqrRoiPjNru/CHpsOvKB9fiLLJFfpmOVos= +github.com/theopenlane/core v0.1.9/go.mod h1:z5sNm0rEmP3dASfbLxFnEZWviur0vdtVLqs1TNSK+bs= github.com/theopenlane/echo-prometheus v0.1.0 h1:1zMejBVHe5w4zLHS+k5FV9S/46QBiwO6ggTSKi6r/7E= github.com/theopenlane/echo-prometheus v0.1.0/go.mod h1:Eiiv1ZLXKMsteQ3T+H1tFfSSZuXSvQfZp95qr5hmGkA= github.com/theopenlane/echox v0.1.0 h1:y4Z2shaODCLwXHsHBrY/EkH/2sIuo49xdIfxx7h+Zvg=