Skip to content

Commit

Permalink
Add .github Setup (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
grounded042 authored Apr 23, 2021
1 parent 575c421 commit f4b59c0
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @auth0/golang-oss-approvers
27 changes: 27 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
push:
branches:
- 'master'
pull_request:
type: [created, synchronize, reopened]
branches:
- '*'
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: install go
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: checkout code
uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
args: -v --timeout=5m --exclude SA1029
skip-build-cache: true
skip-go-installation: true
skip-pkg-cache: true
30 changes: 30 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test
on:
push:
branches:
- 'master'
pull_request:
type: [created, synchronize, reopened]
branches:
- '*'
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: install go
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: checkout code
uses: actions/checkout@v2
- name: test
run: make test
- name: upload coverage to codecov
uses: codecov/codecov-action@v1
with:
file: coverage.out
fail_ci_if_error: true
verbose: true
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DEFAULT_GOAL := help

.PHONY: test
test: ## Run tests.
go test -cover -covermode=atomic -coverprofile=coverage.out ./...

.PHONY: lint
lint: ## Run golangci-lint.
golangci-lint run -v --timeout=5m --exclude SA1029

.PHONY: help
help:
@grep -E '^[%a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 comments on commit f4b59c0

Please sign in to comment.