Skip to content

Commit

Permalink
Merge pull request #202 from izumin5210/izumin5210/github-actions
Browse files Browse the repository at this point in the history
Use GitHub Actions
  • Loading branch information
izumin5210 authored Oct 8, 2019
2 parents f6c7b7d + 336f63e commit e2831ba
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 134 deletions.
124 changes: 0 additions & 124 deletions .circleci/config.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Review
on: [pull_request]
jobs:

golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI
on: [push]
jobs:

test:
runs-on: ubuntu-latest

strategy:
matrix:
go-version: ['1.11.x', '1.12.x', '1.13.x']
test-task: ['test', 'test-e2e']

steps:
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}

- uses: actions/checkout@v1

- name: Install protobuf
run: |
version=3.10.0
archive=protoc-${version}-linux-x86_64
curl -O -L https://github.com/protocolbuffers/protobuf/releases/download/v${version}/${archive}.zip
sudo unzip -d '/usr/local' ${archive}.zip 'bin/*' 'include/*'
rm -rf $archive.zip
protoc --version
if: matrix.test-task == 'test-e2e'

- run: go mod download

- run: make ${{ matrix.test-task }}
env:
TARGET_REVISION: ${{ github.sha }}
COVER: ${{ matrix.go-version == '1.13.x' && matrix.test-task == 'test' }}

- run: curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN
if: matrix.go-version == '1.13.x' && matrix.test-task == 'test'

build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13

- uses: actions/checkout@v1

- run: go mod download

- uses: izumin5210/action-go-crossbuild@releases/v1
with:
package: ./cmd/grapi

- uses: softprops/action-gh-release@v1
with:
files: './dist/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')

- uses: izumin5210/action-homebrew@releases/v0
with:
tap: izumin5210/homebrew-tools
token: ${{ secrets.GITHUB_TOKEN }}
tap-token: ${{ secrets.TAP_GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ build:

.PHONY: lint
lint: ./bin/reviewdog ./bin/golangci-lint
ifdef CI
reviewdog -reporter=github-pr-review
else
reviewdog -diff="git diff master"
endif

.PHONY: test
test:
go test -v ./...

.PHONY: cover
cover:
ifeq ($(COVER),true)
go test -v -coverprofile coverage.txt -covermode atomic ./...
else
go test -v ./...
endif

.PHONY: test-e2e
test-e2e: build
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ![grapi](./grapi.png)
[![CircleCI](https://circleci.com/gh/izumin5210/grapi/tree/master.svg?style=svg)](https://circleci.com/gh/izumin5210/grapi/tree/master)
[![CI](https://github.com/izumin5210/grapi/workflows/CI/badge.svg)](https://github.com/izumin5210/grapi/actions?workflow=CI)
[![GoDoc](https://godoc.org/github.com/izumin5210/grapi/pkg/grapiserver?status.svg)](https://godoc.org/github.com/izumin5210/grapi/pkg/grapiserver)
[![Go Report Card](https://goreportcard.com/badge/github.com/izumin5210/grapi)](https://goreportcard.com/report/github.com/izumin5210/grapi)
[![Go project version](https://badge.fury.io/go/github.com%2Fizumin5210%2Fgrapi.svg)](https://badge.fury.io/go/github.com%2Fizumin5210%2Fgrapi)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/izumin5210/grapi)](http://github.com/izumin5210/grapi/releases/latest)
[![license](https://img.shields.io/github/license/izumin5210/grapi.svg)](./LICENSE)

:open_mouth: A surprisingly easy API server and generator in gRPC and Go
Expand Down

0 comments on commit e2831ba

Please sign in to comment.