From bf9dafca5a42d47af68ee8178b797662d69541bd Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 5 Jun 2024 11:07:38 -0600 Subject: Use mage as build system --- go.mod | 1 + go.sum | 2 ++ magefile.go | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 magefile.go diff --git a/go.mod b/go.mod index c78d8ee..ca02a57 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module gitlab.com/mokhax/stanuki go 1.22 require ( + github.com/magefile/mage v1.15.0 github.com/stretchr/testify v1.8.0 github.com/xlgmokha/x v0.0.0-20221023040112-0610463739d1 ) diff --git a/go.sum b/go.sum index 8ff9c07..b21d658 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/jsonapi v1.0.0 h1:qIGgO5Smu3yJmSs+QlvhQnrscdZfFhiV6S8ryJAglqU= github.com/google/jsonapi v1.0.0/go.mod h1:YYHiRPJT8ARXGER8In9VuLv4qvLfDmA9ULQqptbLE4s= +github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= +github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/magefile.go b/magefile.go new file mode 100644 index 0000000..7831703 --- /dev/null +++ b/magefile.go @@ -0,0 +1,17 @@ +//go:build mage +// +build mage + +package main + +import ( + "github.com/magefile/mage/sh" +) + +// Default target to run when none is specified +// If not set, running mage will list available targets +var Default = Test + +// Run the unit tests +func Test() error { + return sh.RunV("go", "test", "-v", "./...") +} -- cgit v1.2.3