Skip to content

Commit

Permalink
Replace CircleCI with gh actions (#402)
Browse files Browse the repository at this point in the history
* Replace CircleCI with gh actions

* Add build
  • Loading branch information
irisZhangCB authored Apr 27, 2022
1 parent d1ff359 commit d8acfa5
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 114 deletions.
113 changes: 0 additions & 113 deletions .circleci/config.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
push:
branches:
- master
pull_request:

env:
go_version: 1.16
GO111MODULE: on
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}

jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- run: make build
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- run: make test
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 3m

Check-License:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
version: latest
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- run: make check-license

Check-Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
version: latest
- run: make check-format

Check-Gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
version: latest
- run: make check-gen

Coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
version: latest
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- run: make test-cover COVERALLS_TOKEN="$COVERALLS_TOKEN"

Salus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
version: latest
- run: make salus

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# the commands directly.
ADDLICENSE_INSTALL=go install github.com/google/addlicense@latest
ADDLICENSE_CMD=addlicense
ADDLICENCE_SCRIPT=${ADDLICENSE_CMD} -c "Coinbase, Inc." -l "apache" -v
ADDLICENSE_IGNORE=-ignore ".github/**/*" -ignore ".idea/**/*"
ADDLICENCE_SCRIPT=${ADDLICENSE_CMD} -c "Coinbase, Inc." -l "apache" -v ${ADDLICENSE_IGNORE}
GOIMPORTS_INSTALL=go install golang.org/x/tools/cmd/goimports@latest
GOIMPORTS_CMD=goimports
GOLINES_INSTALL=go install github.com/segmentio/golines@latest
Expand All @@ -22,6 +23,9 @@ GO_FOLDERS=$(shell echo ${GO_PACKAGES} | sed -e "s/\.\///g" | sed -e "s/\/\.\.\.
TEST_SCRIPT=go test ${GO_PACKAGES}
LINT_SETTINGS=golint,misspell,gocyclo,gocritic,whitespace,goconst,gocognit,bodyclose,unconvert,lll,unparam

build:
go build ./...

deps:
go install ./...

Expand Down

0 comments on commit d8acfa5

Please sign in to comment.