From 97e55662b14cd0c2ddef86ee4fabb185884b8cc5 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 18:52:21 -0400 Subject: [PATCH 1/8] Add Windows (appveyor) badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e7024c1..0af6ed4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Build Status](https://travis-ci.org/urfave/cli.svg?branch=master)](https://travis-ci.org/urfave/cli) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/rtgk5xufi932pb2v?svg=true)](https://ci.appveyor.com/project/meatballhat/cli) [![GoDoc](https://godoc.org/github.com/urfave/cli?status.svg)](https://godoc.org/github.com/urfave/cli) [![codebeat](https://codebeat.co/badges/0a8f30aa-f975-404b-b878-5fab3ae1cc5f)](https://codebeat.co/projects/github-com-urfave-cli) [![Go Report Card](https://goreportcard.com/badge/urfave/cli)](https://goreportcard.com/report/urfave/cli) From 288d62118aa5ad0b6f980d89d3970bd2c68285a6 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 19:15:05 -0400 Subject: [PATCH 2/8] Try to get appveyor.yml working again --- appveyor.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3ca7afa..f32e013 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,14 +2,25 @@ version: "{build}" os: Windows Server 2012 R2 +environment: + GOPATH: c:\gopath + GOVERSION: 1.6 + install: + - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - set NEW_BUILD_DIR_DEST=c:\gopath\src\github.com\urfave + - mkdir %NEW_BUILD_DIR_DEST% + - move %APPVEYOR_BUILD_FOLDER% %NEW_BUILD_DIR_DEST% + - set APPVEYOR_BUILD_FOLDER=%NEW_BUILD_DIR%\cli - go version - go env + - go get github.com/urfave/gfmxr/... build_script: - cd %APPVEYOR_BUILD_FOLDER% - - go vet ./... - - go test -v ./... + - ./runtests vet + - ./runtests test + - ./runtests gfmxr test: off From 531c7defe7856ab78c8541195bc1b627734e6b6c Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 19:18:38 -0400 Subject: [PATCH 3/8] Trying xcopy instead of move --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f32e013..87a3209 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,8 +10,8 @@ install: - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - set NEW_BUILD_DIR_DEST=c:\gopath\src\github.com\urfave - mkdir %NEW_BUILD_DIR_DEST% - - move %APPVEYOR_BUILD_FOLDER% %NEW_BUILD_DIR_DEST% - - set APPVEYOR_BUILD_FOLDER=%NEW_BUILD_DIR%\cli + - xcopy /s %APPVEYOR_BUILD_FOLDER% %NEW_BUILD_DIR_DEST%\cli + - set APPVEYOR_BUILD_FOLDER=%NEW_BUILD_DIR_DEST%\cli - go version - go env - go get github.com/urfave/gfmxr/... From d277cbf893248383a11a041d2cb15fdf7750e54a Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 19:32:48 -0400 Subject: [PATCH 4/8] Use clone_folder in appveyor.yml instead of dir moving shenanigans --- appveyor.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 87a3209..bc8a8d7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,22 +2,20 @@ version: "{build}" os: Windows Server 2012 R2 +clone_folder: c:\gopath\src\github.com\urfave\cli + environment: GOPATH: c:\gopath GOVERSION: 1.6 install: - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - - set NEW_BUILD_DIR_DEST=c:\gopath\src\github.com\urfave - - mkdir %NEW_BUILD_DIR_DEST% - - xcopy /s %APPVEYOR_BUILD_FOLDER% %NEW_BUILD_DIR_DEST%\cli - - set APPVEYOR_BUILD_FOLDER=%NEW_BUILD_DIR_DEST%\cli - go version - go env - go get github.com/urfave/gfmxr/... + - go get -v -t ./... build_script: - - cd %APPVEYOR_BUILD_FOLDER% - ./runtests vet - ./runtests test - ./runtests gfmxr From 9491a913365076b3400ea60a53440de5c18b6819 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 19:37:59 -0400 Subject: [PATCH 5/8] Try to run a python script --- appveyor.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bc8a8d7..542ef2a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,20 +5,23 @@ os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\urfave\cli environment: - GOPATH: c:\gopath + GOPATH: C:\gopath GOVERSION: 1.6 + PYTHON: C:\Python27-x64 + PYTHON_VERSION: 2.7.x + PYTHON_ARCH: 64 install: - - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - set PATH=%GOPATH%\bin;C:\go\bin;%PATH% - go version - go env - go get github.com/urfave/gfmxr/... - go get -v -t ./... build_script: - - ./runtests vet - - ./runtests test - - ./runtests gfmxr + - python runtests vet + - python runtests test + - python runtests gfmxr test: off From 4566119b39b91e708320cad678d04131e5197a3b Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 19:44:21 -0400 Subject: [PATCH 6/8] Close temporary file before running go tool cover --- runtests | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/runtests b/runtests index b0fd06f..72c1f0d 100755 --- a/runtests +++ b/runtests @@ -49,9 +49,9 @@ def _test(): ('{}/{}'.format(PACKAGE_NAME, subpackage)).rstrip('/') ]) - combined = _combine_coverprofiles(coverprofiles) - _run('go tool cover -func={}'.format(combined.name).split()) - combined.close() + combined_name = _combine_coverprofiles(coverprofiles) + _run('go tool cover -func={}'.format(combined_name).split()) + os.remove(combined_name) def _gfmxr(): @@ -78,7 +78,9 @@ def _is_go_runnable(line): def _combine_coverprofiles(coverprofiles): - combined = tempfile.NamedTemporaryFile(suffix='.coverprofile') + combined = tempfile.NamedTemporaryFile( + suffix='.coverprofile', delete=False + ) combined.write('mode: set\n') for coverprofile in coverprofiles: @@ -88,7 +90,9 @@ def _combine_coverprofiles(coverprofiles): combined.write(line) combined.flush() - return combined + name = combined.name + combined.close() + return name if __name__ == '__main__': From b37df9de86ebf33dd689debd867420484530b66f Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 May 2016 20:35:25 -0400 Subject: [PATCH 7/8] See why README examples are unhappy on Windows --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 542ef2a..5470392 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,6 +10,7 @@ environment: PYTHON: C:\Python27-x64 PYTHON_VERSION: 2.7.x PYTHON_ARCH: 64 + GFMXR_DEBUG: 1 install: - set PATH=%GOPATH%\bin;C:\go\bin;%PATH% From 377aca16cf86f6171a25565625a8ad9eaa763495 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 23 May 2016 19:39:04 -0400 Subject: [PATCH 8/8] Trivial updates to appveyor config --- appveyor.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5470392..173086e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,17 +13,13 @@ environment: GFMXR_DEBUG: 1 install: - - set PATH=%GOPATH%\bin;C:\go\bin;%PATH% - - go version - - go env - - go get github.com/urfave/gfmxr/... - - go get -v -t ./... +- set PATH=%GOPATH%\bin;C:\go\bin;%PATH% +- go version +- go env +- go get github.com/urfave/gfmxr/... +- go get -v -t ./... build_script: - - python runtests vet - - python runtests test - - python runtests gfmxr - -test: off - -deploy: off +- python runtests vet +- python runtests test +- python runtests gfmxr