Skip to content

Commit

Permalink
Merge pull request #6 from shimastripe/feature/github-actions
Browse files Browse the repository at this point in the history
GitHub Actions
  • Loading branch information
shimastripe committed Nov 14, 2021
2 parents 8f8359d + 1f2e0a9 commit 0abb5af
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 16 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion apig/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion script/generation_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0abb5af

Please sign in to comment.