Skip to content

Commit

Permalink
ci: based on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuadros committed Mar 15, 2020
1 parent 8fe5ed7 commit 9d0f15c
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 169 deletions.
75 changes: 71 additions & 4 deletions .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 ./...
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
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

15 changes: 1 addition & 14 deletions CONTRIBUTING.md
Expand Up @@ -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
Expand All @@ -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

Expand Down
36 changes: 0 additions & 36 deletions DCO

This file was deleted.

3 changes: 0 additions & 3 deletions MAINTAINERS

This file was deleted.

14 changes: 5 additions & 9 deletions Makefile
Expand Up @@ -3,20 +3,16 @@ WORKDIR = $(PWD)

# Go parameters
GOCMD = go
GOTEST = $(GOCMD) test -v
GOTEST = $(GOCMD) test

# Git config
GIT_VERSION ?=
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 \
Expand All @@ -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) ./...

Expand Down
21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
6 changes: 1 addition & 5 deletions plumbing/format/idxfile/decoder_test.go
Expand Up @@ -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)
Expand Down
12 changes: 2 additions & 10 deletions plumbing/format/packfile/parser_test.go
Expand Up @@ -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) {
Expand All @@ -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++ {
Expand Down
6 changes: 1 addition & 5 deletions repository_test.go
Expand Up @@ -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 == "" {
Expand Down
18 changes: 3 additions & 15 deletions storage/filesystem/object_test.go
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9d0f15c

Please sign in to comment.