Skip to content

Commit b031368

Browse files
authored
Merge pull request #221 from mattn/drop-support-of-go1.12
drop support of Go 1.12
2 parents 3fa30c7 + 9e8fe1b commit b031368

File tree

7 files changed

+63
-114
lines changed

7 files changed

+63
-114
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,28 @@ jobs:
1212
- macos-latest
1313
- windows-latest
1414
go:
15-
- '1.7' # minimum version that macos-latest supports
16-
- '1.10' # last version that doesn't support go modules
17-
- '1.11' # first version that supports go modules
18-
- '1.x' # latest version
15+
- '1.13' # minimum version
16+
- 'oldstable'
17+
- 'stable'
1918
runs-on: ${{ matrix.os }}
2019

2120
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
ref: ${{ github.event.pull_request.head.sha }}
24+
2225
- name: Set up Go ${{ matrix.go }}
23-
uses: actions/setup-go@v2
26+
uses: actions/setup-go@v4
2427
with:
2528
go-version: ${{ matrix.go }}
2629
- run: go version
27-
- name: Set up GOPATH
28-
shell: bash
29-
run: |
30-
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
31-
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
3230

33-
- uses: actions/checkout@v2
34-
with:
35-
path: src/github.com/mattn/goveralls
36-
ref: ${{ github.event.pull_request.head.sha }}
3731
- name: build
3832
run: |
3933
go get ./...
4034
go install .
41-
working-directory: src/github.com/mattn/goveralls
4235
- name: test
4336
run: goveralls -service=github -parallel -flagname="Unit-${{ matrix.os }}-Go-${{ matrix.go }}"
44-
working-directory: src/github.com/mattn/goveralls
4537
env:
4638
COVERALLS_TOKEN: ${{ github.token }}
4739
GIT_BRANCH: ${{ github.head_ref }}
@@ -50,13 +42,11 @@ jobs:
5042
needs: test
5143
runs-on: ubuntu-latest
5244
steps:
53-
- name: Set up Go
54-
uses: actions/setup-go@v2
55-
with:
56-
go-version: '1.x'
57-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
5846
with:
5947
ref: ${{ github.event.pull_request.head.sha }}
48+
- name: Set up Go
49+
uses: actions/setup-go@v4
6050
- name: finish
6151
run: |
6252
go run github.com/mattn/goveralls -parallel-finish

README.md

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ continuous code coverage tracking system.
66

77
# Installation
88

9-
`goveralls` requires a working Go installation (Go-1.2 or higher).
9+
`goveralls` requires a working Go installation (Go-1.13 or higher).
1010

1111
```bash
1212
$ go install github.com/mattn/goveralls@latest
@@ -38,7 +38,7 @@ docs](https://docs.coveralls.io/parallel-build-webhook) for more details).
3838
There is no need to run `go test` separately, as `goveralls` runs the entire
3939
test suite.
4040

41-
## Github Actions
41+
## GitHub Actions
4242

4343
[shogo82148/actions-goveralls](https://github.com/marketplace/actions/actions-goveralls) is available on GitHub Marketplace.
4444
It provides the shorthand of the GitHub Actions YAML configure.
@@ -76,56 +76,13 @@ jobs:
7676
# path-to-profile: covprofile
7777
```
7878

79-
### Test with Legacy GOPATH mode
80-
81-
If you want to use Go 1.10 or earlier, you have to set `GOPATH` environment value and the working directory.
82-
See <https://github.com/golang/go/wiki/GOPATH> for more detail.
83-
84-
Here is an example for testing `example.com/owner/repo` package.
85-
86-
```yaml
87-
name: Quality
88-
on: [push, pull_request]
89-
jobs:
90-
test:
91-
name: Test with Coverage
92-
runs-on: ubuntu-latest
93-
steps:
94-
- name: Set up Go
95-
uses: actions/setup-go@v2
96-
with:
97-
go-version: '1.10'
98-
99-
# add this step
100-
- name: Set up GOPATH
101-
run: |
102-
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
103-
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
104-
105-
- name: Check out code
106-
uses: actions/checkout@v2
107-
with:
108-
path: src/example.com/owner/repo # add this
109-
- name: Run Unit tests
110-
run: |
111-
go test -race -covermode atomic -coverprofile=covprofile ./...
112-
working-directory: src/example.com/owner/repo # add this
113-
- name: Install goveralls
114-
run: go install github.com/mattn/goveralls@latest
115-
- name: Send coverage
116-
env:
117-
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118-
run: goveralls -coverprofile=covprofile -service=github
119-
working-directory: src/example.com/owner/repo # add this
120-
```
121-
12279
## Travis CI
12380

12481
### GitHub Integration
12582

126-
Enable Travis-CI on your github repository settings.
83+
Enable Travis-CI on your GitHub repository settings.
12784

128-
For a **public** github repository put bellow's `.travis.yml`.
85+
For a **public** GitHub repository put bellow's `.travis.yml`.
12986

13087
```yml
13188
language: go
@@ -137,9 +94,9 @@ script:
13794
- $GOPATH/bin/goveralls -service=travis-ci
13895
```
13996
140-
For a **public** github repository, it is not necessary to define your repository key (`COVERALLS_TOKEN`).
97+
For a **public** GitHub repository, it is not necessary to define your repository key (`COVERALLS_TOKEN`).
14198

142-
For a **private** github repository put bellow's `.travis.yml`. If you use **travis pro**, you need to specify `-service=travis-pro` instead of `-service=travis-ci`.
99+
For a **private** GitHub repository put bellow's `.travis.yml`. If you use **travis pro**, you need to specify `-service=travis-pro` instead of `-service=travis-ci`.
143100

144101
```yml
145102
language: go

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module github.com/mattn/goveralls
22

3-
go 1.17
3+
go 1.13
44

55
require (
6-
golang.org/x/mod v0.4.2
7-
golang.org/x/tools v0.1.1
6+
golang.org/x/mod v0.10.0
7+
golang.org/x/tools v0.8.0
88
)
9-
10-
require golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect

go.sum

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
12
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
2-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
3-
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
4-
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
5-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
3+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
4+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
5+
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
6+
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
7+
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
68
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
9+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
10+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
11+
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
12+
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
713
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
14+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
15+
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
16+
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
817
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
9-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
10-
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
18+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
19+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
20+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
21+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
22+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
23+
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
24+
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
25+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
26+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
27+
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
28+
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
1129
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
30+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
31+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
32+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
33+
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
34+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
1235
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
13-
golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs=
14-
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
36+
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
37+
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
38+
golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
39+
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
1540
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
16-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
17-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
18-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

gocover.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"path/filepath"
1717
"strings"
1818

19+
"golang.org/x/mod/modfile"
1920
"golang.org/x/tools/cover"
2021
)
2122

@@ -176,3 +177,12 @@ func parseCover(fn string) ([]*SourceFile, error) {
176177

177178
return sourceFiles, nil
178179
}
180+
181+
func findRootPackage(rootDirectory string) string {
182+
modPath := filepath.Join(rootDirectory, "go.mod")
183+
content, err := ioutil.ReadFile(modPath)
184+
if err != nil {
185+
return ""
186+
}
187+
return modfile.ModulePath(content)
188+
}

gocover_ge1.8.go

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

gocover_lt1.8.go

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

0 commit comments

Comments
 (0)