diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ab0cc2c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Main + +on: [push] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + #- name: Lint + # run: | + # curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0 + # golangci-lint run -c ./.golangci.yml ./src/... + - name: Build & test + run: | + go build -v . + go test -v ./test/unit/*.go + #go test -v ./test/functional/*.go diff --git a/go.mod b/go.mod index 3bcfce7..5c20956 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/fbonhomm/api-go-example +module github.com/sundowndev/api-go-example go 1.12 diff --git a/main.go b/main.go index f28a1e3..5b72520 100644 --- a/main.go +++ b/main.go @@ -11,8 +11,8 @@ import ( "github.com/joho/godotenv" - "github.com/fbonhomm/api-go-example/source/routers" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/routers" + "github.com/sundowndev/api-go-example/src/services" ) // init diff --git a/src/controllers/auth.go b/src/controllers/auth.go index d5f74db..c070f56 100644 --- a/src/controllers/auth.go +++ b/src/controllers/auth.go @@ -11,9 +11,9 @@ import ( "github.com/gin-gonic/gin" - "github.com/fbonhomm/api-go-example/source/libs" - "github.com/fbonhomm/api-go-example/source/models" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/libs" + "github.com/sundowndev/api-go-example/src/models" + "github.com/sundowndev/api-go-example/src/services" ) // AuthLogin diff --git a/src/controllers/user.go b/src/controllers/user.go index 7cf14a6..695de64 100644 --- a/src/controllers/user.go +++ b/src/controllers/user.go @@ -11,8 +11,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/fbonhomm/api-go-example/source/models" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/models" + "github.com/sundowndev/api-go-example/src/services" ) // UserCreate diff --git a/src/libs/generate-access-token.go b/src/libs/generate-access-token.go index 43a5af5..f7c3c4e 100644 --- a/src/libs/generate-access-token.go +++ b/src/libs/generate-access-token.go @@ -12,8 +12,8 @@ import ( "github.com/dgrijalva/jwt-go" - "github.com/fbonhomm/api-go-example/source/models" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/models" + "github.com/sundowndev/api-go-example/src/services" ) // GenerateAccessToken diff --git a/src/libs/generate-refresh-token.go b/src/libs/generate-refresh-token.go index 35deaa5..835cdff 100644 --- a/src/libs/generate-refresh-token.go +++ b/src/libs/generate-refresh-token.go @@ -12,8 +12,8 @@ import ( "github.com/dgrijalva/jwt-go" - "github.com/fbonhomm/api-go-example/source/models" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/models" + "github.com/sundowndev/api-go-example/src/services" ) // GenerateRefreshToken diff --git a/src/middlewares/jwt.go b/src/middlewares/jwt.go index 94284ac..5215295 100644 --- a/src/middlewares/jwt.go +++ b/src/middlewares/jwt.go @@ -13,8 +13,8 @@ import ( "github.com/dgrijalva/jwt-go" "github.com/gin-gonic/gin" - "github.com/fbonhomm/api-go-example/source/libs" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/libs" + "github.com/sundowndev/api-go-example/src/services" ) func Auth(c *gin.Context) { diff --git a/src/routers/auth.go b/src/routers/auth.go index 48180f4..d0541f3 100644 --- a/src/routers/auth.go +++ b/src/routers/auth.go @@ -9,9 +9,9 @@ package routers import ( "github.com/gin-gonic/gin" - "github.com/fbonhomm/api-go-example/source/controllers" - "github.com/fbonhomm/api-go-example/source/middlewares" - "github.com/fbonhomm/api-go-example/source/validators" + "github.com/sundowndev/api-go-example/src/controllers" + "github.com/sundowndev/api-go-example/src/middlewares" + "github.com/sundowndev/api-go-example/src/validators" ) // main diff --git a/src/routers/user.go b/src/routers/user.go index b188f87..a6ecc0b 100644 --- a/src/routers/user.go +++ b/src/routers/user.go @@ -9,9 +9,9 @@ package routers import ( "github.com/gin-gonic/gin" - "github.com/fbonhomm/api-go-example/source/controllers" - "github.com/fbonhomm/api-go-example/source/middlewares" - "github.com/fbonhomm/api-go-example/source/validators" + "github.com/sundowndev/api-go-example/src/controllers" + "github.com/sundowndev/api-go-example/src/middlewares" + "github.com/sundowndev/api-go-example/src/validators" ) // main diff --git a/src/services/database.go b/src/services/database.go index ef3482b..ca91d7a 100644 --- a/src/services/database.go +++ b/src/services/database.go @@ -15,7 +15,7 @@ import ( // initialize dialects _ "github.com/jinzhu/gorm/dialects/postgres" - "github.com/fbonhomm/api-go-example/source/models" + "github.com/sundowndev/api-go-example/src/models" ) var Db *gorm.DB diff --git a/test/functional/main_test.go b/test/functional/main_test.go index b86ffb4..9e99564 100644 --- a/test/functional/main_test.go +++ b/test/functional/main_test.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" "github.com/joho/godotenv" - "github.com/fbonhomm/api-go-example/source/services" - "github.com/fbonhomm/api-go-example/test/fixture" + "github.com/sundowndev/api-go-example/src/services" + "github.com/sundowndev/api-go-example/test/fixture" ) type Token struct { diff --git a/test/functional/user-get-id_test.go b/test/functional/user-get-id_test.go index 908e1aa..6d468cf 100644 --- a/test/functional/user-get-id_test.go +++ b/test/functional/user-get-id_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/fbonhomm/api-go-example/test/fixture" + "github.com/sundowndev/api-go-example/test/fixture" ) // TestGetId diff --git a/test/functional/utils.go b/test/functional/utils.go index a651670..02ddb96 100644 --- a/test/functional/utils.go +++ b/test/functional/utils.go @@ -14,9 +14,9 @@ import ( "net/url" "strings" - "github.com/fbonhomm/api-go-example/source/models" - "github.com/fbonhomm/api-go-example/source/routers" - "github.com/fbonhomm/api-go-example/source/services" + "github.com/sundowndev/api-go-example/src/models" + "github.com/sundowndev/api-go-example/src/routers" + "github.com/sundowndev/api-go-example/src/services" ) // RequestApiJson diff --git a/test/unit/validator_user-create_test.go b/test/unit/validator_user-create_test.go index b3f24ed..b1d33b3 100644 --- a/test/unit/validator_user-create_test.go +++ b/test/unit/validator_user-create_test.go @@ -15,7 +15,7 @@ import ( "github.com/gin-gonic/gin" "github.com/stretchr/testify/assert" - "github.com/fbonhomm/api-go-example/source/validators" + "github.com/sundowndev/api-go-example/src/validators" ) // TestShouldSuccessValidatorUserCreate