Create main workflow (#1)

master
Raphaël 2019-11-27 17:23:25 +01:00 committed by GitHub
parent e616666443
commit 2cfe1b9185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 62 additions and 28 deletions

34
.github/workflows/main.yml vendored Normal file
View File

@ -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
View File

@ -1,4 +1,4 @@
module github.com/fbonhomm/api-go-example
module github.com/sundowndev/api-go-example
go 1.12

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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