diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1131836 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build + +on: push + +jobs: + + build: + strategy: + matrix: + go-version: [1.16.x, 1.17.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Deps + run: | + make deps + - name: Build Test + run: | + make install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0b9de21 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: Test + +on: push + +jobs: + + build: + strategy: + matrix: + go-version: [1.16.x, 1.17.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Deps + run: | + make deps + - name: Test + run: | + make test + - name: Generation Test + run: | + make generation-test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 953d738..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: go -go: - - '1.6' - - '1.7' -env: - - GO15VENDOREXPERIMENT=1 -install: - - make deps -script: - - make test - - make generation-test diff --git a/README.md b/README.md index 9f64842..5e9e98c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # apig: Golang RESTful API Server Generator -[![Build Status](https://travis-ci.org/wantedly/apig.svg?branch=master)](https://travis-ci.org/wantedly/apig) +[![Build](https://github.com/shimastripe/apig/actions/workflows/build.yml/badge.svg)](https://github.com/shimastripe/apig/actions/workflows/build.yml) +[![Test](https://github.com/shimastripe/apig/actions/workflows/test.yml/badge.svg)](https://github.com/shimastripe/apig/actions/workflows/test.yml) apig is an RESTful API server generator. @@ -29,7 +30,7 @@ apig is an RESTful API server generator. ## How to build and install -Go 1.6 or higher is required. +Go 1.16 or higher is required. After installing required version of Go, you can build and install `apig` by @@ -53,7 +54,7 @@ First, creating by `apig new` command. $ apig new -u shimastripe apig-sample ``` -generates Golang API server boilerplate under `$GOPATH/src/gihhub.com/wantedly/apig-sample`. +generates Golang API server boilerplate under `$GOPATH/src/github.com/shimastripe/apig-sample`. apig supports two database engines; SQLite (`sqlite`) and PostgreSQL (`postgres`) and Mysql (`mysql`). You can specify this by `-d, -database` option. Available command line options of `apig new` command are: diff --git a/apig/generate_test.go b/apig/generate_test.go index 6ed2f58..0029f29 100644 --- a/apig/generate_test.go +++ b/apig/generate_test.go @@ -46,7 +46,7 @@ var userModel = &Model{ var detail = &Detail{ VCS: "github.com", - User: "wantedly", + User: "shimastripe", Project: "api-server", Model: userModel, Models: []*Model{userModel}, diff --git a/script/generation_test.sh b/script/generation_test.sh index 5ea7de5..fb914b3 100755 --- a/script/generation_test.sh +++ b/script/generation_test.sh @@ -13,7 +13,7 @@ if [[ ! $(git status . | grep 'nothing to commit') ]]; then fi echo "===> Building API server..." -go mod init +go mod init github.com/shimastripe/apig/_example go mod tidy go build