Skip to content

Commit 2c49687

Browse files
unknwonSourcegraph Bot
andauthored
ci: migrate from Travis to GitHub Actions (#50)
* ci: migrate from Travis to GitHub Actions * Fix lint errors Co-authored-by: Sourcegraph Bot <[email protected]>
1 parent 0d17b78 commit 2c49687

File tree

7 files changed

+52
-24
lines changed

7 files changed

+52
-24
lines changed

.github/workflows/go.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Go
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
env:
7+
GOPROXY: "https://proxy.golang.org"
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Run golangci-lint
16+
uses: actions-contrib/golangci-lint@v1
17+
18+
test:
19+
name: Test
20+
strategy:
21+
matrix:
22+
go-version: [1.13.x, 1.14.x]
23+
platform: [ubuntu-latest, macos-latest, windows-latest]
24+
runs-on: ${{ matrix.platform }}
25+
steps:
26+
- name: Install Go
27+
uses: actions/setup-go@v1
28+
with:
29+
go-version: ${{ matrix.go-version }}
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
- name: Run unit tests
33+
run: go test -v -race -coverprofile=coverage -covermode=atomic ./...
34+
- name: Upload coverage report to Codecov
35+
uses: codecov/[email protected]
36+
with:
37+
file: ./coverage
38+
flags: unittests
39+
- name: Cache downloaded modules
40+
uses: actions/cache@v1
41+
with:
42+
path: ~/go/pkg/mod
43+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
44+
restore-keys: |
45+
${{ runner.os }}-go-

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Git Module
22

3-
[![Build Status](https://img.shields.io/travis/gogs/git-module/master.svg?style=for-the-badge&logo=travis)](https://travis-ci.org/gogs/git-module) [![Build status](https://img.shields.io/appveyor/ci/unknwon/gogs-git-module?logo=appveyor&style=for-the-badge)](https://ci.appveyor.com/project/unknwon/gogs-git-module/branch/master) [![codecov](https://img.shields.io/codecov/c/github/gogs/git-module/master?logo=codecov&style=for-the-badge)](https://codecov.io/gh/gogs/git-module) [![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/gogs/git-module?tab=doc) [![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/gogs/git-module)
3+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/gogs/git-module/Go?logo=github&style=for-the-badge)](https://github.com/gogs/git-module/actions?query=workflow%3AGo)
4+
[![codecov](https://img.shields.io/codecov/c/github/gogs/git-module/master?logo=codecov&style=for-the-badge)](https://codecov.io/gh/gogs/git-module)
5+
[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/gogs/git-module?tab=doc)
6+
[![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/gogs/git-module)
47

58
Package git-module is a Go module for Git access through shell commands.
69

diff.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,5 +505,4 @@ func StreamParseDiff(r io.Reader, done chan<- SteamParseDiffResult, maxFiles, ma
505505
Diff: diff,
506506
Err: err,
507507
}
508-
return
509508
}

repo_commit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (r *Repository) CatFileCommit(rev string, opts ...CatFileCommitOptions) (*C
8787
return cache.(*Commit), nil
8888
}
8989

90-
commitID, err := r.RevParse(rev, RevParseOptions{Timeout: opt.Timeout})
90+
commitID, err := r.RevParse(rev, RevParseOptions{Timeout: opt.Timeout}) //nolint
9191
if err != nil {
9292
return nil, err
9393
}

repo_diff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (r *Repository) RawDiff(rev string, diffType RawDiffFormat, w io.Writer, op
8585
opt = opts[0]
8686
}
8787

88-
commit, err := r.CatFileCommit(rev, CatFileCommitOptions{Timeout: opt.Timeout})
88+
commit, err := r.CatFileCommit(rev, CatFileCommitOptions{Timeout: opt.Timeout}) //nolint
8989
if err != nil {
9090
return err
9191
}

repo_tree.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (r *Repository) LsTree(rev string, opts ...LsTreeOptions) (*Tree, error) {
100100
}
101101

102102
var err error
103-
rev, err = r.RevParse(rev, RevParseOptions{Timeout: opt.Timeout})
103+
rev, err = r.RevParse(rev, RevParseOptions{Timeout: opt.Timeout}) //nolint
104104
if err != nil {
105105
return nil, err
106106
}

0 commit comments

Comments
 (0)