Skip to content

Commit 9d0f15c

Browse files
committed
ci: based on github actions
1 parent 8fe5ed7 commit 9d0f15c

File tree

15 files changed

+90
-169
lines changed

15 files changed

+90
-169
lines changed

.github/workflows/test.yml

+71-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,85 @@
11
on: [push, pull_request]
22
name: Test
33
jobs:
4-
test:
4+
version-matrix:
55
strategy:
6+
fail-fast: false
67
matrix:
7-
go-version: [1.12.x, 1.13.x, 1.14.x]
8+
go-version: [1.13.x, 1.14.x]
89
platform: [ubuntu-latest, macos-latest, windows-latest]
10+
911
runs-on: ${{ matrix.platform }}
1012
steps:
1113
- name: Install Go
1214
uses: actions/setup-go@v1
1315
with:
14-
go-version: ${{ matrix.go-version }}
16+
go-version: ${{ matrix.go-version }}
17+
1518
- name: Checkout code
1619
uses: actions/checkout@v2
20+
21+
- name: Configure known hosts
22+
if: matrix.platform != 'ubuntu-latest'
23+
run: |
24+
mkdir -p ~/.ssh
25+
ssh-keyscan -H github.com > ~/.ssh/known_hosts
26+
27+
- name: Set Git config
28+
run: |
29+
git config --global user.email "[email protected]"
30+
git config --global user.name "GitHub Actions"
31+
1732
- name: Test
18-
run: go test -v ./...
33+
run: make test-coverage
34+
35+
- name: Convert coverage to lcov
36+
if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.14.x'
37+
uses: jandelgado/[email protected]
38+
with:
39+
infile: coverage.out
40+
outfile: coverage.lcov
41+
42+
- name: Coveralls
43+
if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.14.x'
44+
uses: coverallsapp/github-action@master
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
path-to-lcov: coverage.lcov
48+
49+
git-matrix:
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
git: [[master, ubuntu-latest], [v2.11.0, ubuntu-latest]]
54+
55+
runs-on: ${{ matrix.git[1] }}
56+
env:
57+
GIT_VERSION: ${{ matrix.git[0] }}
58+
GIT_DIST_PATH: .git-dist/${{ matrix.git[0] }}
59+
60+
steps:
61+
- name: Install Go
62+
uses: actions/setup-go@v1
63+
with:
64+
go-version: 1.14.x
65+
66+
- name: Checkout code
67+
uses: actions/checkout@v2
68+
69+
- name: Install build dependencies
70+
run: sudo apt-get install gettext
71+
72+
- name: Git Build
73+
run: make build-git
74+
75+
- name: Set Git config
76+
run: |
77+
git config --global user.email "[email protected]"
78+
git config --global user.name "GitHub Actions"
79+
export PATH=$GIT_DIST_PATH:$PATH
80+
81+
82+
- name: Test
83+
env:
84+
GIT_EXEC_PATH: ${{ env.GIT_DIST_PATH }}
85+
run: make test-coverage

.travis.yml

-37
This file was deleted.

CONTRIBUTING.md

+1-14
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,12 @@ contributions via GitHub pull requests. This document outlines some of the
55
conventions on development workflow, commit message formatting, contact points,
66
and other resources to make it easier to get your contribution accepted.
77

8-
## Certificate of Origin
9-
10-
By contributing to this project you agree to the [Developer Certificate of
11-
Origin (DCO)](DCO). This document was created by the Linux Kernel community and is a
12-
simple statement that you, as a contributor, have the legal right to make the
13-
contribution.
14-
15-
In order to show your agreement with the DCO you should include at the end of commit message,
16-
the following line: `Signed-off-by: John Doe <[email protected]>`, using your real name.
17-
18-
This can be done easily using the [`-s`](https://github.com/git/git/blob/b2c150d3aa82f6583b9aadfecc5f8fa1c74aca09/Documentation/git-commit.txt#L154-L161) flag on the `git commit`.
19-
208
## Support Channels
219

2210
The official support channels, for both users and contributors, are:
2311

2412
- [StackOverflow go-git tag](https://stackoverflow.com/questions/tagged/go-git) for user questions.
2513
- GitHub [Issues](https://github.com/src-d/go-git/issues)* for bug reports and feature requests.
26-
- Slack: #go-git room in the [source{d} Slack](https://join.slack.com/t/sourced-community/shared_invite/enQtMjc4Njk5MzEyNzM2LTFjNzY4NjEwZGEwMzRiNTM4MzRlMzQ4MmIzZjkwZmZlM2NjODUxZmJjNDI1OTcxNDAyMmZlNmFjODZlNTg0YWM)
2714

2815
*Before opening a new issue or submitting a new pull request, it's helpful to
2916
search the project - it's likely that another user has already reported the
@@ -42,7 +29,7 @@ In order for a PR to be accepted it needs to pass a list of requirements:
4229
- They should in general include tests, and those shall pass.
4330
- If the PR is a bug fix, it has to include a suite of unit tests for the new functionality.
4431
- If the PR is a new feature, it has to come with a suite of unit tests, that tests the new functionality.
45-
- In any case, all the PRs have to pass the personal evaluation of at least one of the [maintainers](MAINTAINERS) of go-git.
32+
- In any case, all the PRs have to pass the personal evaluation of at least one of the maintainers of go-git.
4633

4734
### Format of the commit message
4835

DCO

-36
This file was deleted.

MAINTAINERS

-3
This file was deleted.

Makefile

+5-9
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@ WORKDIR = $(PWD)
33

44
# Go parameters
55
GOCMD = go
6-
GOTEST = $(GOCMD) test -v
6+
GOTEST = $(GOCMD) test
77

88
# Git config
99
GIT_VERSION ?=
1010
GIT_DIST_PATH ?= $(PWD)/.git-dist
1111
GIT_REPOSITORY = http://github.com/git/git.git
1212

1313
# Coverage
14-
COVERAGE_REPORT = coverage.txt
15-
COVERAGE_MODE = atomic
16-
17-
ifneq ($(origin CI), undefined)
18-
WORKDIR := $(GOPATH)/src/github.com/go-git/go-git/v5
19-
endif
14+
COVERAGE_REPORT = coverage.out
15+
COVERAGE_MODE = count
2016

2117
build-git:
2218
@if [ -f $(GIT_DIST_PATH)/git ]; then \
@@ -30,11 +26,11 @@ build-git:
3026
fi
3127

3228
test:
33-
@cd $(WORKDIR); \
29+
@echo "running against `git version`"; \
3430
$(GOTEST) ./...
3531

3632
test-coverage:
37-
@cd $(WORKDIR); \
33+
@echo "running against `git version`"; \
3834
echo "" > $(COVERAGE_REPORT); \
3935
$(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./...
4036

appveyor.yml

-21
This file was deleted.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/gliderlabs/ssh v0.2.2
99
github.com/go-git/gcfg v1.5.0
1010
github.com/go-git/go-billy/v5 v5.0.0
11-
github.com/go-git/go-git-fixtures/v4 v4.0.0
11+
github.com/go-git/go-git-fixtures/v4 v4.0.1
1212
github.com/google/go-cmp v0.3.0
1313
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
1414
github.com/jessevdk/go-flags v1.4.0

go.sum

+2-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjr
1414
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
1515
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
1616
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
17-
github.com/go-git/gcfg v1.4.0 h1:+MzT7ImUasMEDSPwAGvAj2pFbN28BYzw5vM/4UZIIfE=
18-
github.com/go-git/gcfg v1.4.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
1917
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
2018
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
2119
github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
2220
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
23-
github.com/go-git/go-git-fixtures/v4 v4.0.0 h1:2CMMjgatjbdysXcvT23ctyFjkR2w4420flyGwGvDQ6E=
24-
github.com/go-git/go-git-fixtures/v4 v4.0.0/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
21+
github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc=
22+
github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
2523
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
2624
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
2725
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
@@ -47,8 +45,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
4745
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
4846
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
4947
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
50-
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
51-
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
5248
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
5349
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
5450
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=

plumbing/format/idxfile/decoder_test.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,7 @@ func BenchmarkDecode(b *testing.B) {
124124
b.Errorf("unexpected error reading idx file: %s", err)
125125
}
126126

127-
defer func() {
128-
if err := fixtures.Clean(); err != nil {
129-
b.Errorf("unexpected error cleaning fixtures: %s", err)
130-
}
131-
}()
127+
defer fixtures.Clean()
132128

133129
for i := 0; i < b.N; i++ {
134130
f := bytes.NewBuffer(fixture)

plumbing/format/packfile/parser_test.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,7 @@ func (t *testObserver) put(pos int64, o observerObject) {
192192
}
193193

194194
func BenchmarkParse(b *testing.B) {
195-
defer func() {
196-
if err := fixtures.Clean(); err != nil {
197-
b.Fatal(err)
198-
}
199-
}()
195+
defer fixtures.Clean()
200196

201197
for _, f := range fixtures.ByTag("packfile") {
202198
b.Run(f.URL, func(b *testing.B) {
@@ -216,11 +212,7 @@ func BenchmarkParse(b *testing.B) {
216212
}
217213

218214
func BenchmarkParseBasic(b *testing.B) {
219-
defer func() {
220-
if err := fixtures.Clean(); err != nil {
221-
b.Fatal(err)
222-
}
223-
}()
215+
defer fixtures.Clean()
224216

225217
f := fixtures.Basic().One()
226218
for i := 0; i < b.N; i++ {

repository_test.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -2844,11 +2844,7 @@ func (s *RepositorySuite) TestBrokenMultipleShallowFetch(c *C) {
28442844
}
28452845

28462846
func BenchmarkObjects(b *testing.B) {
2847-
defer func() {
2848-
if err := fixtures.Clean(); err != nil {
2849-
b.Fatal(err)
2850-
}
2851-
}()
2847+
defer fixtures.Clean()
28522848

28532849
for _, f := range fixtures.ByTag("packfile") {
28542850
if f.DotGitHash == "" {

storage/filesystem/object_test.go

+3-15
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,7 @@ func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) {
333333
}
334334

335335
func BenchmarkPackfileIter(b *testing.B) {
336-
defer func() {
337-
if err := fixtures.Clean(); err != nil {
338-
b.Fatal(err)
339-
}
340-
}()
336+
defer fixtures.Clean()
341337

342338
for _, f := range fixtures.ByTag(".git") {
343339
b.Run(f.URL, func(b *testing.B) {
@@ -385,11 +381,7 @@ func BenchmarkPackfileIter(b *testing.B) {
385381
}
386382

387383
func BenchmarkPackfileIterReadContent(b *testing.B) {
388-
defer func() {
389-
if err := fixtures.Clean(); err != nil {
390-
b.Fatal(err)
391-
}
392-
}()
384+
defer fixtures.Clean()
393385

394386
for _, f := range fixtures.ByTag(".git") {
395387
b.Run(f.URL, func(b *testing.B) {
@@ -447,11 +439,7 @@ func BenchmarkPackfileIterReadContent(b *testing.B) {
447439
}
448440

449441
func BenchmarkGetObjectFromPackfile(b *testing.B) {
450-
defer func() {
451-
if err := fixtures.Clean(); err != nil {
452-
b.Fatal(err)
453-
}
454-
}()
442+
defer fixtures.Clean()
455443

456444
for _, f := range fixtures.Basic() {
457445
b.Run(f.URL, func(b *testing.B) {

0 commit comments

Comments
 (0)