diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-03-15 21:18:32 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2020-03-15 21:18:32 +0100 |
commit | 9d0f15c4fa712cdacfa3887e9baac918f093fbf6 (patch) | |
tree | eb1a4db1169ba4bb9ae58727a462d54f93f5f85c | |
parent | 8fe5ed769fa01a42eafb3b7f064ffe8e0d436408 (diff) | |
download | go-git-9d0f15c4fa712cdacfa3887e9baac918f093fbf6.tar.gz |
ci: based on github actionsv5.0.0
-rw-r--r-- | .github/workflows/test.yml | 75 | ||||
-rw-r--r-- | .travis.yml | 37 | ||||
-rw-r--r-- | CONTRIBUTING.md | 15 | ||||
-rw-r--r-- | DCO | 36 | ||||
-rw-r--r-- | MAINTAINERS | 3 | ||||
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | appveyor.yml | 21 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 8 | ||||
-rw-r--r-- | plumbing/format/idxfile/decoder_test.go | 6 | ||||
-rw-r--r-- | plumbing/format/packfile/parser_test.go | 12 | ||||
-rw-r--r-- | repository_test.go | 6 | ||||
-rw-r--r-- | storage/filesystem/object_test.go | 18 | ||||
-rw-r--r-- | storage/test/storage_suite.go | 2 | ||||
-rw-r--r-- | worktree_test.go | 4 |
15 files changed, 90 insertions, 169 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf1651e..16640a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,18 +1,85 @@ on: [push, pull_request] name: Test jobs: - test: + version-matrix: strategy: + fail-fast: false matrix: - go-version: [1.12.x, 1.13.x, 1.14.x] + go-version: [1.13.x, 1.14.x] platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} steps: - name: Install Go uses: actions/setup-go@v1 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.go-version }} + - name: Checkout code uses: actions/checkout@v2 + + - name: Configure known hosts + if: matrix.platform != 'ubuntu-latest' + run: | + mkdir -p ~/.ssh + ssh-keyscan -H github.com > ~/.ssh/known_hosts + + - name: Set Git config + run: | + git config --global user.email "gha@example.com" + git config --global user.name "GitHub Actions" + - name: Test - run: go test -v ./...
\ No newline at end of file + run: make test-coverage + + - name: Convert coverage to lcov + if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.14.x' + uses: jandelgado/gcov2lcov-action@v1.0.0 + with: + infile: coverage.out + outfile: coverage.lcov + + - name: Coveralls + if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.14.x' + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage.lcov + + git-matrix: + strategy: + fail-fast: false + matrix: + git: [[master, ubuntu-latest], [v2.11.0, ubuntu-latest]] + + runs-on: ${{ matrix.git[1] }} + env: + GIT_VERSION: ${{ matrix.git[0] }} + GIT_DIST_PATH: .git-dist/${{ matrix.git[0] }} + + steps: + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: 1.14.x + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install build dependencies + run: sudo apt-get install gettext + + - name: Git Build + run: make build-git + + - name: Set Git config + run: | + git config --global user.email "gha@example.com" + git config --global user.name "GitHub Actions" + export PATH=$GIT_DIST_PATH:$PATH + + + - name: Test + env: + GIT_EXEC_PATH: ${{ env.GIT_DIST_PATH }} + run: make test-coverage diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 00b478e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: go - -go: - - "1.11" - - "1.12" - -go_import_path: github.com/go-git/go-git/v5 - -env: - - GIT_VERSION=master - - GIT_VERSION=v1.9.3 - - GIT_VERSION=v2.11.0 - -cache: - directories: - - $HOME/.git-dist - -before_script: - - export GIT_DIST_PATH=$HOME/.git-dist - - make build-git - -before_install: - - git config --global user.email "travis@example.com" - - git config --global user.name "Travis CI" - -install: - - go get -v -t ./... - -script: - - export GIT_EXEC_PATH=$GIT_DIST_PATH - - export PATH=$GIT_DIST_PATH:$PATH - - git version - - make test-coverage - - go vet ./... - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bdb5f73..fce2532 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,25 +5,12 @@ contributions via GitHub pull requests. This document outlines some of the conventions on development workflow, commit message formatting, contact points, and other resources to make it easier to get your contribution accepted. -## Certificate of Origin - -By contributing to this project you agree to the [Developer Certificate of -Origin (DCO)](DCO). This document was created by the Linux Kernel community and is a -simple statement that you, as a contributor, have the legal right to make the -contribution. - -In order to show your agreement with the DCO you should include at the end of commit message, -the following line: `Signed-off-by: John Doe <john.doe@example.com>`, using your real name. - -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`. - ## Support Channels The official support channels, for both users and contributors, are: - [StackOverflow go-git tag](https://stackoverflow.com/questions/tagged/go-git) for user questions. - GitHub [Issues](https://github.com/src-d/go-git/issues)* for bug reports and feature requests. -- Slack: #go-git room in the [source{d} Slack](https://join.slack.com/t/sourced-community/shared_invite/enQtMjc4Njk5MzEyNzM2LTFjNzY4NjEwZGEwMzRiNTM4MzRlMzQ4MmIzZjkwZmZlM2NjODUxZmJjNDI1OTcxNDAyMmZlNmFjODZlNTg0YWM) *Before opening a new issue or submitting a new pull request, it's helpful to 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: - They should in general include tests, and those shall pass. - If the PR is a bug fix, it has to include a suite of unit tests for the new functionality. - If the PR is a new feature, it has to come with a suite of unit tests, that tests the new functionality. -- In any case, all the PRs have to pass the personal evaluation of at least one of the [maintainers](MAINTAINERS) of go-git. +- In any case, all the PRs have to pass the personal evaluation of at least one of the maintainers of go-git. ### Format of the commit message @@ -1,36 +0,0 @@ -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved.
\ No newline at end of file diff --git a/MAINTAINERS b/MAINTAINERS deleted file mode 100644 index ff2129c..0000000 --- a/MAINTAINERS +++ /dev/null @@ -1,3 +0,0 @@ -Máximo Cuadros <mcuadros@gmail.com> (@mcuadros) -Jeremy Stribling <strib@alum.mit.edu> (@strib) -Ori Rawlings <orirawlings@gmail.com> (@orirawlings) @@ -3,7 +3,7 @@ WORKDIR = $(PWD) # Go parameters GOCMD = go -GOTEST = $(GOCMD) test -v +GOTEST = $(GOCMD) test # Git config GIT_VERSION ?= @@ -11,12 +11,8 @@ GIT_DIST_PATH ?= $(PWD)/.git-dist GIT_REPOSITORY = http://github.com/git/git.git # Coverage -COVERAGE_REPORT = coverage.txt -COVERAGE_MODE = atomic - -ifneq ($(origin CI), undefined) - WORKDIR := $(GOPATH)/src/github.com/go-git/go-git/v5 -endif +COVERAGE_REPORT = coverage.out +COVERAGE_MODE = count build-git: @if [ -f $(GIT_DIST_PATH)/git ]; then \ @@ -30,11 +26,11 @@ build-git: fi test: - @cd $(WORKDIR); \ + @echo "running against `git version`"; \ $(GOTEST) ./... test-coverage: - @cd $(WORKDIR); \ + @echo "running against `git version`"; \ echo "" > $(COVERAGE_REPORT); \ $(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./... diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 160616b..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: "{build}" -platform: x64 - -matrix: - allow_failures: - - platform: x64 - -clone_folder: c:\gopath\src\gopkg.in\src-d\go-git.v4 - -environment: - GOPATH: c:\gopath - -install: - - set PATH=%GOPATH%\bin;c:\go\bin;"C:\Program Files\Git\mingw64\bin";%PATH% - - go version - - go get -v -t ./... - - git config --global user.email "travis@example.com" - - git config --global user.name "Travis CI - -build_script: - - go test -v ./... @@ -8,7 +8,7 @@ require ( github.com/gliderlabs/ssh v0.2.2 github.com/go-git/gcfg v1.5.0 github.com/go-git/go-billy/v5 v5.0.0 - github.com/go-git/go-git-fixtures/v4 v4.0.0 + github.com/go-git/go-git-fixtures/v4 v4.0.1 github.com/google/go-cmp v0.3.0 github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 github.com/jessevdk/go-flags v1.4.0 @@ -14,14 +14,12 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjr github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.4.0 h1:+MzT7ImUasMEDSPwAGvAj2pFbN28BYzw5vM/4UZIIfE= -github.com/go-git/gcfg v1.4.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.0 h1:2CMMjgatjbdysXcvT23ctyFjkR2w4420flyGwGvDQ6E= -github.com/go-git/go-git-fixtures/v4 v4.0.0/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 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 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= diff --git a/plumbing/format/idxfile/decoder_test.go b/plumbing/format/idxfile/decoder_test.go index 467e242..94059cc 100644 --- a/plumbing/format/idxfile/decoder_test.go +++ b/plumbing/format/idxfile/decoder_test.go @@ -124,11 +124,7 @@ func BenchmarkDecode(b *testing.B) { b.Errorf("unexpected error reading idx file: %s", err) } - defer func() { - if err := fixtures.Clean(); err != nil { - b.Errorf("unexpected error cleaning fixtures: %s", err) - } - }() + defer fixtures.Clean() for i := 0; i < b.N; i++ { f := bytes.NewBuffer(fixture) diff --git a/plumbing/format/packfile/parser_test.go b/plumbing/format/packfile/parser_test.go index fb5fb7f..57a9c17 100644 --- a/plumbing/format/packfile/parser_test.go +++ b/plumbing/format/packfile/parser_test.go @@ -192,11 +192,7 @@ func (t *testObserver) put(pos int64, o observerObject) { } func BenchmarkParse(b *testing.B) { - defer func() { - if err := fixtures.Clean(); err != nil { - b.Fatal(err) - } - }() + defer fixtures.Clean() for _, f := range fixtures.ByTag("packfile") { b.Run(f.URL, func(b *testing.B) { @@ -216,11 +212,7 @@ func BenchmarkParse(b *testing.B) { } func BenchmarkParseBasic(b *testing.B) { - defer func() { - if err := fixtures.Clean(); err != nil { - b.Fatal(err) - } - }() + defer fixtures.Clean() f := fixtures.Basic().One() for i := 0; i < b.N; i++ { diff --git a/repository_test.go b/repository_test.go index f13a755..e366373 100644 --- a/repository_test.go +++ b/repository_test.go @@ -2844,11 +2844,7 @@ func (s *RepositorySuite) TestBrokenMultipleShallowFetch(c *C) { } func BenchmarkObjects(b *testing.B) { - defer func() { - if err := fixtures.Clean(); err != nil { - b.Fatal(err) - } - }() + defer fixtures.Clean() for _, f := range fixtures.ByTag("packfile") { if f.DotGitHash == "" { diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go index 6c35129..2d6f568 100644 --- a/storage/filesystem/object_test.go +++ b/storage/filesystem/object_test.go @@ -333,11 +333,7 @@ func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) { } func BenchmarkPackfileIter(b *testing.B) { - defer func() { - if err := fixtures.Clean(); err != nil { - b.Fatal(err) - } - }() + defer fixtures.Clean() for _, f := range fixtures.ByTag(".git") { b.Run(f.URL, func(b *testing.B) { @@ -385,11 +381,7 @@ func BenchmarkPackfileIter(b *testing.B) { } func BenchmarkPackfileIterReadContent(b *testing.B) { - defer func() { - if err := fixtures.Clean(); err != nil { - b.Fatal(err) - } - }() + defer fixtures.Clean() for _, f := range fixtures.ByTag(".git") { b.Run(f.URL, func(b *testing.B) { @@ -447,11 +439,7 @@ func BenchmarkPackfileIterReadContent(b *testing.B) { } func BenchmarkGetObjectFromPackfile(b *testing.B) { - defer func() { - if err := fixtures.Clean(); err != nil { - b.Fatal(err) - } - }() + defer fixtures.Clean() for _, f := range fixtures.Basic() { b.Run(f.URL, func(b *testing.B) { diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go index a646fad..d87a7dd 100644 --- a/storage/test/storage_suite.go +++ b/storage/test/storage_suite.go @@ -66,7 +66,7 @@ func NewBaseStorageSuite(s Storer) BaseStorageSuite { } func (s *BaseStorageSuite) TearDownTest(c *C) { - c.Assert(fixtures.Clean(), IsNil) + fixtures.Clean() } func (s *BaseStorageSuite) TestSetEncodedObjectAndEncodedObject(c *C) { diff --git a/worktree_test.go b/worktree_test.go index 1485189..838762f 100644 --- a/worktree_test.go +++ b/worktree_test.go @@ -12,6 +12,7 @@ import ( "testing" "time" + fixtures "github.com/go-git/go-git-fixtures/v4" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/filemode" @@ -25,7 +26,6 @@ import ( "github.com/go-git/go-billy/v5/util" "golang.org/x/text/unicode/norm" . "gopkg.in/check.v1" - "github.com/go-git/go-git-fixtures/v4" ) type WorktreeSuite struct { @@ -692,7 +692,7 @@ func (s *WorktreeSuite) TestCheckoutBisect(c *C) { c.Skip("skipping test in short mode.") } - s.testCheckoutBisect(c, "https://github.com/src-d/go-git.git") + s.testCheckoutBisect(c, "https://github.com/go-git/go-git.git") } func (s *WorktreeSuite) TestCheckoutBisectSubmodules(c *C) { |