Skip to content

Commit 1ddb1ab

Browse files
authored
chore: various config updates to CI (#76)
1 parent 14e6573 commit 1ddb1ab

File tree

7 files changed

+59
-15
lines changed

7 files changed

+59
-15
lines changed

.github/workflows/go.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ jobs:
3232
shell: bash
3333
run: |
3434
go mod tidy
35-
STATUS=$(git status --porcelain go.mod go.sum)
35+
STATUS=$(git status --porcelain)
3636
if [ ! -z "$STATUS" ]; then
37-
echo "Running go mod tidy modified go.mod and/or go.sum"
37+
echo "Unstaged files:"
38+
echo $STATUS
39+
echo "Run 'go mod tidy' and commit them"
3840
exit 1
3941
fi
4042
4143
test:
4244
name: Test
4345
strategy:
4446
matrix:
45-
go-version: [ 1.16.x, 1.17.x, 1.18.x ]
47+
go-version: [ 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x ]
4648
platform: [ ubuntu-latest, macos-latest, windows-latest ]
4749
runs-on: ${{ matrix.platform }}
4850
steps:

.github/workflows/lsif.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
21
name: LSIF
3-
on: [push]
2+
on:
3+
push:
4+
paths:
5+
- '**.go'
6+
- 'go.mod'
7+
- '.github/workflows/lsif.yml'
8+
env:
9+
GOPROXY: "https://proxy.golang.org"
10+
411
jobs:
5-
build:
12+
lsif-go:
13+
if: github.repository == 'gogs/git-module'
614
runs-on: ubuntu-latest
715
steps:
8-
- uses: actions/checkout@v1
16+
- uses: actions/checkout@v2
917
- name: Generate LSIF data
1018
uses: sourcegraph/lsif-go-action@master
19+
- name: Upload LSIF data to sourcegraph.com
20+
continue-on-error: true
21+
uses: docker://sourcegraph/src-cli:latest
1122
with:
12-
verbose: 'true'
13-
- name: Upload LSIF data
14-
uses: sourcegraph/lsif-upload-action@master
23+
args: lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}
24+
- name: Upload LSIF data to cs.unknwon.dev
1525
continue-on-error: true
26+
uses: docker://sourcegraph/src-cli:latest
1627
with:
17-
endpoint: https://sourcegraph.com
18-
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
args: -endpoint=https://cs.unknwon.dev lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}

.golangci.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
linters-settings:
2+
staticcheck:
3+
checks: [
4+
"all",
5+
"-SA1019" # There are valid use cases of strings.Title
6+
]
7+
nakedret:
8+
max-func-lines: 0 # Disallow any unnamed return statement
9+
10+
linters:
11+
enable:
12+
- deadcode
13+
- errcheck
14+
- gosimple
15+
- govet
16+
- ineffassign
17+
- staticcheck
18+
- structcheck
19+
- typecheck
20+
- unused
21+
- varcheck
22+
- nakedret
23+
- gofmt
24+
- rowserrcheck
25+
- unconvert
26+
- goimports
27+
- unparam

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Package git-module is a Go module for Git access through shell commands.
99

1010
## Requirements
1111

12-
- Go version must be at least **1.9**.
12+
- Go version must be at least **1.13**.
1313
- Git version must be no less than **1.8.3**.
1414
- For Windows users, try to use the latest version of both.
1515

codecov.yml

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ coverage:
44
project:
55
default:
66
threshold: 1%
7+
informational: true
8+
patch:
9+
defualt:
10+
only_pulls: true
11+
informational: true
712

813
comment:
914
layout: 'diff'

commit_submodule.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (c *Commit) Submodules() (Submodules, error) {
6464
if len(path) > 0 && len(url) > 0 {
6565
mod := &Submodule{
6666
Name: path,
67-
URL: url,
67+
URL: url,
6868
}
6969

7070
mod.Commit, c.submodulesErr = c.repo.RevParse(c.id.String() + ":" + mod.Name)

repo_tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (r *Repository) getTag(timeout time.Duration, id *SHA1) (*Tag, error) {
9191
tag.id = id
9292
tag.repo = r
9393
default:
94-
return nil, fmt.Errorf("unsupported tag type: %s", ObjectType(typ))
94+
return nil, fmt.Errorf("unsupported tag type: %s", typ)
9595
}
9696

9797
r.cachedTags.Set(id.String(), tag)

0 commit comments

Comments
 (0)