Create main workflow (#1)
parent
e616666443
commit
2cfe1b9185
|
@ -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
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
|||
module github.com/fbonhomm/api-go-example
|
||||
module github.com/sundowndev/api-go-example
|
||||
|
||||
go 1.12
|
||||
|
||||
|
|
4
main.go
4
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue