Skip to content

Commit

Permalink
Merge pull request #5 from kenzo0107/feature/adjust_directories
Browse files Browse the repository at this point in the history
Feature/adjust directories
  • Loading branch information
kenzo0107 committed Dec 17, 2019
2 parents 49e2acd + a15263d commit a6afbb1
Show file tree
Hide file tree
Showing 26 changed files with 1,374 additions and 304 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: static check
on: push

jobs:
imports:
name: Imports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: imports
token: ${{ secrets.GITHUB_TOKEN }}

errcheck:
name: Errcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: errcheck
token: ${{ secrets.GITHUB_TOKEN }}

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: lint
token: ${{ secrets.GITHUB_TOKEN }}

shadow:
name: Shadow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: shadow
token: ${{ secrets.GITHUB_TOKEN }}

staticcheck:
name: StaticCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: staticcheck
token: ${{ secrets.GITHUB_TOKEN }}

sec:
name: Sec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: sec
token: ${{ secrets.GITHUB_TOKEN }}
flags: "-exclude=G106"
8 changes: 4 additions & 4 deletions .github/workflows/go.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
on: [push, pull_request]
name: Test
on: [push]
jobs:
test:
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
go-version: [1.13.x]
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
Expand All @@ -15,4 +15,4 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1
- name: Test
run: go vet ./...
run: go test -v -count=1 -cover ./...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.envrc
cmd/omssh/omssh
bin/*
cover.out
dist
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,35 @@ deps:
go get -v -d

## Setup
.PHONY: deps
.PHONY: devel-deps
devel-deps: deps
GO111MODULE=off go get \
github.com/golang/lint/golint \
golang.org/x/lint/golint \
honnef.co/go/tools/staticcheck \
github.com/kisielk/errcheck \
golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow \
github.com/securego/gosec/cmd/gosec \
github.com/motemen/gobump/cmd/gobump \
github.com/Songmu/make2help/cmd/make2help

## Run tests
.PHONY: test
test: deps
go test ./...
go test -v -count=1 -cover ./...

.PHONY: cov
cov:
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out

## Lint
.PHONY: lint
lint: devel-deps
go vet ./...
staticcheck ./...
errcheck ./...
# exclude G106: Audit the use of ssh.InsecureIgnoreHostKey
gosec -quiet -exclude=G106 ./...
golint -set_exit_status ./...

## build binaries ex. make bin/omssh
Expand All @@ -50,10 +63,10 @@ help:
.PHONY: clean
clean:
rm -f bin/${NAME}
rm -f pkg/*

.PHONY: release
release:
@git tag v$(VERSION)
@git push --tags
goreleaser --rm-dist

Loading

0 comments on commit a6afbb1

Please sign in to comment.