Skip to content
Permalink
Browse files

rework CI with Go 1.14 and Windows support

Thanks to lessons learned in other Go repositories.
  • Loading branch information
mvdan committed Mar 14, 2020
1 parent 960b1ec commit 0ac8026f7d064766d7b775b7613104e23e4ad439
@@ -0,0 +1,2 @@
# To prevent CRLF breakages on Windows for fragile files, like testdata.
* -text
@@ -4,17 +4,15 @@ jobs:
test:
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
# platform: [ubuntu-latest, macos-latest, windows-latest]
# TODO: reenable windows once %LocalAppData% is set
platform: [ubuntu-latest, macos-latest]
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 }}
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Test
run: go test ./...
4 go.mod
@@ -1,8 +1,8 @@
module mvdan.cc/unparam

require (
github.com/rogpeppe/go-internal v1.3.2
golang.org/x/tools v0.0.0-20190911151314-feee8acb394c
github.com/rogpeppe/go-internal v1.5.2
golang.org/x/tools v0.0.0-20200313205530-4303120df7d8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

21 go.sum
@@ -3,16 +3,29 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/rogpeppe/go-internal v1.3.2 h1:XU784Pr0wdahMY2bYcyK6N1KuaRAdLtqD4qd8D18Bfs=
github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.5.2 h1:qLvObTrvO/XRCqmkKxUlOBc48bI3efyDuAZe25QiF0w=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190911151314-feee8acb394c h1:Z68bwv5Kf04vdnGGHkuVaXWsvmeiFHysXpV8x6/8r0A=
golang.org/x/tools v0.0.0-20190911151314-feee8acb394c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200313205530-4303120df7d8 h1:gkI/wGGwpcG5W4hLCzZNGxA4wzWBGGDStRI1MrjDl2Q=
golang.org/x/tools v0.0.0-20200313205530-4303120df7d8/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
@@ -5,6 +5,7 @@ import (
"path/filepath"
"testing"

"github.com/rogpeppe/go-internal/gotooltest"
"github.com/rogpeppe/go-internal/testscript"
)

@@ -16,7 +17,15 @@ func TestMain(m *testing.M) {

func TestScripts(t *testing.T) {
t.Parallel()
testscript.Run(t, testscript.Params{
p := testscript.Params{
Dir: filepath.Join("testdata", "scripts"),
})
Setup: func(env *testscript.Env) error {
env.Vars = append(env.Vars, "/="+string(os.PathSeparator))
return nil
},
}
if err := gotooltest.Setup(&p); err != nil {
t.Fatal(err)
}
testscript.Run(t, p)
}
@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,14 +1,12 @@
env HOME=$WORK/home

! unparam ./...
cmp stdout stdout.golden
cmpenv stdout stdout.golden

-- go.mod --
module testdata.tld/foo
-- stdout.golden --
foo.go:7:19: oneUnused - b is unused
foo.go:49:38: (*EnsuredImpl).otherMethod - b is unused
main/main.go:5:19: oneUnused - b is unused
main${/}main.go:5:19: oneUnused - b is unused
-- foo.go --
package foo

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
stdout 'fooUnused .* unused'
! stdout 'footestUnused .* unused'
@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

@@ -1,5 +1,3 @@
env HOME=$WORK/home

! unparam .
cmp stdout stdout.golden

0 comments on commit 0ac8026

Please sign in to comment.
You can’t perform that action at this time.