-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Go | ||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '.golangci.yml' | ||
- '.github/workflows/go.yml' | ||
pull_request: | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '.golangci.yml' | ||
- '.github/workflows/go.yml' | ||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: latest | ||
args: --timeout=30m | ||
|
||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
go-version: [ 1.16.x ] | ||
platform: [ ubuntu-latest, macos-latest, windows-latest ] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run tests with coverage | ||
run: go test -v -race -coverprofile=coverage -covermode=atomic ./... | ||
- name: Upload coverage report to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage | ||
flags: unittests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: LSIF | ||
on: | ||
push: | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '.github/workflows/lsif.yml' | ||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
|
||
jobs: | ||
lsif-go: | ||
if: github.repository == 'flamego/auth' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Generate LSIF data | ||
uses: sourcegraph/lsif-go-action@master | ||
- name: Upload LSIF data to sourcegraph.com | ||
continue-on-error: true | ||
uses: docker://sourcegraph/src-cli:latest | ||
with: | ||
args: lsif upload -github-token=${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload LSIF data to sourcegraph.unknwon.cn | ||
continue-on-error: true | ||
uses: docker://sourcegraph/src-cli:latest | ||
with: | ||
args: -endpoint=https://sourcegraph.unknwon.cn lsif upload -github-token=${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
linters-settings: | ||
nakedret: | ||
max-func-lines: 0 # Disallow any unnamed return statement | ||
|
||
linters: | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unused | ||
- varcheck | ||
- nakedret | ||
- gofmt | ||
- rowserrcheck | ||
- unconvert | ||
- goimports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2021 Flamego. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
coverage: | ||
range: "60...95" | ||
status: | ||
project: | ||
default: | ||
threshold: 1% | ||
|
||
comment: | ||
layout: 'diff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/flamego/auth | ||
|
||
go 1.16 |