Skip to content

Commit f4b59c0

Browse files
authored
Add .github Setup (#85)
1 parent 575c421 commit f4b59c0

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @auth0/golang-oss-approvers

.github/workflows/lint.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
pull_request:
7+
type: [created, synchronize, reopened]
8+
branches:
9+
- '*'
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: install go
16+
uses: actions/setup-go@v1
17+
with:
18+
go-version: 1.14
19+
- name: checkout code
20+
uses: actions/checkout@v2
21+
- name: golangci-lint
22+
uses: golangci/golangci-lint-action@v2
23+
with:
24+
args: -v --timeout=5m --exclude SA1029
25+
skip-build-cache: true
26+
skip-go-installation: true
27+
skip-pkg-cache: true

.github/workflows/test.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
pull_request:
7+
type: [created, synchronize, reopened]
8+
branches:
9+
- '*'
10+
jobs:
11+
test:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: install go
18+
uses: actions/setup-go@v1
19+
with:
20+
go-version: 1.14
21+
- name: checkout code
22+
uses: actions/checkout@v2
23+
- name: test
24+
run: make test
25+
- name: upload coverage to codecov
26+
uses: codecov/codecov-action@v1
27+
with:
28+
file: coverage.out
29+
fail_ci_if_error: true
30+
verbose: true

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DEFAULT_GOAL := help
2+
3+
.PHONY: test
4+
test: ## Run tests.
5+
go test -cover -covermode=atomic -coverprofile=coverage.out ./...
6+
7+
.PHONY: lint
8+
lint: ## Run golangci-lint.
9+
golangci-lint run -v --timeout=5m --exclude SA1029
10+
11+
.PHONY: help
12+
help:
13+
@grep -E '^[%a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 commit comments

Comments
 (0)