From 2ac65b7a87f7427e5d94793792d0f826295e1b04 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:04:38 -0500 Subject: [PATCH 01/11] #3 fixed a typo --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9dfd7d6..0a49300 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -33,5 +33,5 @@ jobs: - name: Build run: go build -v . - - test: Test + - name: Test run: go test -v . From fa3049f8d48787c856751480b39d4f3903f27a97 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:15:51 -0500 Subject: [PATCH 02/11] added coveralls support --- .github/workflows/go.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0a49300..a830499 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -34,4 +34,16 @@ jobs: run: go build -v . - name: Test - run: go test -v . + run: go test -v -covermode=count -coverprofile=coverage.out + + - name: Coverage for coveralls + uses: jandelgado/gcov2lcov-action@v1.0.0 + with: + infile: coverage.out + outfile: coverage.lcov + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage.lcov \ No newline at end of file From b12c20fdad213b2c068de0ad59979231a22f6505 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:20:04 -0500 Subject: [PATCH 03/11] fixing coverage --- .github/workflows/go.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a830499..71a467e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -34,7 +34,9 @@ jobs: run: go build -v . - name: Test - run: go test -v -covermode=count -coverprofile=coverage.out + run: | + export PATH=$PATH:$(go env GOPATH)/bin + go test -v -covermode=count -coverprofile=coverage.out - name: Coverage for coveralls uses: jandelgado/gcov2lcov-action@v1.0.0 From 823b4dc739bb23cdb141b599059415b26c24fc52 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:34:49 -0500 Subject: [PATCH 04/11] fixing coverage --- .github/workflows/go.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 71a467e..9b1bebc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -33,19 +33,27 @@ jobs: - name: Build run: go build -v . - - name: Test + coverage: + runs-on: ubuntu-latest + steps: + - name: Install Go + if: success() + uses: actions/setup-go@v1 + with: + go-version: 1.13.x + - name: Checkout code + uses: actions/checkout@v1 + - name: Calc coverage run: | - export PATH=$PATH:$(go env GOPATH)/bin + export PATH=$PATH:$(go env GOPATH)/bin go test -v -covermode=count -coverprofile=coverage.out - - - name: Coverage for coveralls + - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 with: - infile: coverage.out - outfile: coverage.lcov - + infile: coverage.out + outfile: coverage.lcov - name: Coveralls - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v1.0.1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: coverage.lcov \ No newline at end of file + github-token: ${{ secrets.github_token }} + path-to-lcov: coverage.lcov \ No newline at end of file From 489d50e7ba87a6a3d754a47642c965f2637491e7 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:40:00 -0500 Subject: [PATCH 05/11] tests --- .github/workflows/go.yml | 75 ++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 19 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9b1bebc..b690eaf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -8,30 +8,41 @@ on: jobs: - build: - name: Build + lint: runs-on: ubuntu-latest steps: - - - name: Set up Go 1.13 + - name: Install Go uses: actions/setup-go@v1 with: - go-version: 1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + go-version: 1.13.x + - name: Checkout code + uses: actions/checkout@v1 + - name: Install golangci-lint + run: | + go get github.com/golangci/golangci-lint/cmd/golangci-lint + - name: Run linters + run: | + export PATH=$PATH:$(go env GOPATH)/bin + ./pre-commit - - name: Get dependencies + test: + strategy: + matrix: + go-version: [1.13.x, 1.14.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + if: success() + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v1 + - name: Run tests run: | go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: go build -v . + go test -v -covermode=count coverage: runs-on: ubuntu-latest @@ -45,7 +56,8 @@ jobs: uses: actions/checkout@v1 - name: Calc coverage run: | - export PATH=$PATH:$(go env GOPATH)/bin + export PATH=$PATH:$(go env GOPATH)/bin + go get -v -t -d ./... go test -v -covermode=count -coverprofile=coverage.out - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 @@ -56,4 +68,29 @@ jobs: uses: coverallsapp/github-action@v1.0.1 with: github-token: ${{ secrets.github_token }} - path-to-lcov: coverage.lcov \ No newline at end of file + path-to-lcov: coverage.lcov + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: go build -v . From 7db680060e6f3374e38d11bd7217c6bf270b1827 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:50:08 -0500 Subject: [PATCH 06/11] tests --- .github/workflows/go.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b690eaf..55e63a8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,24 +7,6 @@ on: branches: [ master ] jobs: - - lint: - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: 1.13.x - - name: Checkout code - uses: actions/checkout@v1 - - name: Install golangci-lint - run: | - go get github.com/golangci/golangci-lint/cmd/golangci-lint - - name: Run linters - run: | - export PATH=$PATH:$(go env GOPATH)/bin - ./pre-commit - test: strategy: matrix: @@ -51,7 +33,7 @@ jobs: if: success() uses: actions/setup-go@v1 with: - go-version: 1.13.x + go-version: 1.14.x - name: Checkout code uses: actions/checkout@v1 - name: Calc coverage @@ -64,6 +46,11 @@ jobs: with: infile: coverage.out outfile: coverage.lcov + - name: Upload coverage results + uses: actions/upload-artifact@v1 + with: + name: coverage.lcov + path: coverage.lcov - name: Coveralls uses: coverallsapp/github-action@v1.0.1 with: From 5a2336187a34ae8103ae9ba9add99f112f524de3 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:52:25 -0500 Subject: [PATCH 07/11] tests --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 55e63a8..6ef81ae 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -40,7 +40,7 @@ jobs: run: | export PATH=$PATH:$(go env GOPATH)/bin go get -v -t -d ./... - go test -v -covermode=count -coverprofile=coverage.out + go test -v . -covermode=count -coverprofile=coverage.out - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 with: @@ -50,7 +50,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: coverage.lcov - path: coverage.lcov + path: coverage.* - name: Coveralls uses: coverallsapp/github-action@v1.0.1 with: From b87aabab9711575379ec1e5cbf4c7ee596ee4d7b Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 15:57:02 -0500 Subject: [PATCH 08/11] tests --- .github/workflows/go.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6ef81ae..e676101 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -41,16 +41,12 @@ jobs: export PATH=$PATH:$(go env GOPATH)/bin go get -v -t -d ./... go test -v . -covermode=count -coverprofile=coverage.out + cat coverage.out - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 with: infile: coverage.out outfile: coverage.lcov - - name: Upload coverage results - uses: actions/upload-artifact@v1 - with: - name: coverage.lcov - path: coverage.* - name: Coveralls uses: coverallsapp/github-action@v1.0.1 with: From bffefb1b432e4c528d01815e808b8c1712d39be5 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 16:19:48 -0500 Subject: [PATCH 09/11] tests --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e676101..b312e3b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -41,6 +41,7 @@ jobs: export PATH=$PATH:$(go env GOPATH)/bin go get -v -t -d ./... go test -v . -covermode=count -coverprofile=coverage.out + sed -i "s/_$(pwd|sed 's/\//\\\//g')/./g" coverage.out cat coverage.out - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 From 2d03ba8c9dd53c3bd5da3d69253d34210d01f7fd Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 16:26:03 -0500 Subject: [PATCH 10/11] tests --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b312e3b..f36cc84 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -41,7 +41,7 @@ jobs: export PATH=$PATH:$(go env GOPATH)/bin go get -v -t -d ./... go test -v . -covermode=count -coverprofile=coverage.out - sed -i "s/_$(pwd|sed 's/\//\\\//g')/./g" coverage.out + sed -i "s/$(pwd|sed 's/\//\\\//g')/./g" coverage.out cat coverage.out - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 From 0d4fd56fb0c79f97d06f348c4cab6f8b89eb0745 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Thu, 9 Apr 2020 16:29:49 -0500 Subject: [PATCH 11/11] tests --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f36cc84..96f5334 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -41,8 +41,8 @@ jobs: export PATH=$PATH:$(go env GOPATH)/bin go get -v -t -d ./... go test -v . -covermode=count -coverprofile=coverage.out + # Required because the coverage.out file on github actions has a path that breaks gcov2lcov sed -i "s/$(pwd|sed 's/\//\\\//g')/./g" coverage.out - cat coverage.out - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 with: