Skip to content

Commit 5aa399b

Browse files
authored
adds GHA (#205)
* adds GHA * make test and host lookup error reporting less env. dependent
1 parent 4319f91 commit 5aa399b

File tree

9 files changed

+71
-62
lines changed

9 files changed

+71
-62
lines changed
File renamed without changes.

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: /go/src/github.com/openzipkin/zipkin-go
5+
parallelism: 1
6+
docker:
7+
- image: circleci/golang
8+
steps:
9+
- checkout
10+
- run: go mod download
11+
- run: make vet test bench

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- "**/*.md"
8+
- "LICENSE"
9+
pull_request:
10+
11+
jobs:
12+
"CI":
13+
env:
14+
GO111MODULE: on
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [macos-latest, windows-latest, ubuntu-latest]
19+
go: ["1.17"]
20+
include:
21+
- os: ubuntu-latest
22+
go: "1.14"
23+
- os: ubuntu-latest
24+
go: "1.15"
25+
- os: ubuntu-latest
26+
go: "1.16"
27+
steps:
28+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
29+
- name: Check out code
30+
uses: actions/[email protected]
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Setup go
35+
uses: actions/setup-go@v1
36+
with:
37+
go-version: ${{ matrix.go }}
38+
39+
- name: Lint files
40+
uses: golangci/golangci-lint-action@v2
41+
with:
42+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
43+
version: latest
44+
45+
- name: Run tests
46+
run: go test -coverprofile coverage.txt -v ./...
47+
env:
48+
CGO_ENABLED: 1
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v1
52+
with:
53+
name: zipkin-go test reports
54+
fail_ci_if_error: true
55+
files: ./coverage.txt

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ linters:
2222

2323
linters-settings:
2424
dupl:
25-
threshold: 400
26-
lll:
25+
threshold: 400
26+
lll:
2727
line-length: 170
2828
gocyclo:
2929
min-complexity: 20

.travis.yml

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

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ limitations under the License.
1616

1717
# Zipkin Library for Go
1818

19-
[![Travis CI](https://travis-ci.org/openzipkin/zipkin-go.svg?branch=master)](https://travis-ci.org/openzipkin/zipkin-go)
2019
[![CircleCI](https://circleci.com/gh/openzipkin/zipkin-go.svg?style=shield)](https://circleci.com/gh/openzipkin/zipkin-go)
2120
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/1d0e5k96g10ajl63/branch/master?svg=true)](https://ci.appveyor.com/project/basvanbeek/zipkin-go)
2221
[![Coverage Status](https://img.shields.io/coveralls/github/openzipkin/zipkin-go.svg)](https://coveralls.io/github/openzipkin/zipkin-go?branch=master)

circle.yml

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

endpoint.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package zipkin
1616

1717
import (
18+
"fmt"
1819
"net"
1920
"strconv"
2021
"strings"
@@ -54,7 +55,7 @@ func NewEndpoint(serviceName string, hostPort string) (*model.Endpoint, error) {
5455

5556
addrs, err := net.LookupIP(host)
5657
if err != nil {
57-
return nil, err
58+
return nil, fmt.Errorf("host lookup failure: %w", err)
5859
}
5960

6061
for i := range addrs {

endpoint_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestNewEndpointFailsDueToLookupIP(t *testing.T) {
107107
t.Fatal("expected error")
108108
}
109109

110-
if !strings.Contains(err.Error(), "no such host") {
110+
if !strings.Contains(err.Error(), "host lookup failure") {
111111
t.Fatalf("expected no such host error, got: %s", err.Error())
112112
}
113113
}

0 commit comments

Comments
 (0)