diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..ba12c1d2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Delve CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{matrix.os}} + strategy: + matrix: + include: + - go: 1.15 + os: macos-latest + - go: 1.14 + os: ubuntu-latest + - go: 1.13 + os: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v1 + with: + go-version: ${{matrix.go}} + - run: go run _scripts/make.go test diff --git a/.travis.yml b/.travis.yml index 47fbf7b1..f67ecf3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,6 @@ go_import_path: github.com/go-delve/delve os: - linux - - osx - - windows arch: - amd64 @@ -13,39 +11,18 @@ arch: go: - 1.15.3 # hold back version of Go, see issue #42484 - - 1.14.x - - 1.13.x - tip matrix: allow_failures: - go: tip exclude: - - os: osx - arch: arm64 - - os: windows - arch: arm64 - - os: windows - go: 1.14.x - - os: windows - go: 1.13.x - - os: osx - go: 1.14.x - - os: osx - go: 1.13.x - - arch: arm64 - go: 1.14.x - - arch: arm64 - go: 1.13.x - - os: windows - go: tip - arch: arm64 go: tip before_install: - export GOFLAGS=-mod=vendor - if [ $TRAVIS_OS_NAME = "linux" ]; then sudo apt-get -qq update; sudo apt-get install -y dwz; echo "dwz version $(dwz --version)"; fi - - if [ $TRAVIS_OS_NAME = "windows" ]; then choco install procdump make --ignorechecksum; fi # 386 linux diff --git a/README.md b/README.md index a594e7b1..8d2595f9 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/go-delve/delve/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-delve/delve?status.svg)](https://godoc.org/github.com/go-delve/delve) [![Build Status](https://travis-ci.org/go-delve/delve.svg?branch=master)](https://travis-ci.org/go-delve/delve) +[![Build status](https://ci.appveyor.com/api/projects/status/0v8r99smxost466s/branch/master?svg=true)](https://ci.appveyor.com/project/derekparker/delve-facy3/branch/master) The GitHub issue tracker is for **bugs** only. Please use the [developer mailing list](https://groups.google.com/forum/#!forum/delve-dev) for any feature proposals and discussions. diff --git a/_scripts/gen-travis.go b/_scripts/gen-travis.go index 607e8306..2f4cf25b 100644 --- a/_scripts/gen-travis.go +++ b/_scripts/gen-travis.go @@ -55,56 +55,38 @@ func main() { } } - out := bufio.NewWriter(os.Stdout) - err := template.Must(template.New("travis.yml").Parse(`language: go + travisfh, err := os.Create(".travis.yml") + if err != nil { + fmt.Fprintf(os.Stderr, "could not create .travis.yml: %v") + os.Exit(1) + } + + out := bufio.NewWriter(travisfh) + err = template.Must(template.New("travis.yml").Parse(`language: go sudo: required go_import_path: github.com/go-delve/delve os: - linux - - osx - - windows arch: - amd64 - arm64 go: -{{- range .GoVersions}} - - {{.DotX}} -{{- end}} + - {{index .GoVersions 0}} - tip matrix: allow_failures: - go: tip exclude: - - os: osx - arch: arm64 - - os: windows - arch: arm64 -{{- /* Exclude all testing on anything except the most recent version of Go for anything that isn't (GOOS=linux, GOARCH=amd64)*/ -}} -{{- range .GoVersions}}{{if not .MaxVersion}} - - os: windows - go: {{.DotX}} -{{- end}}{{end -}} -{{- range .GoVersions}}{{if not .MaxVersion}} - - os: osx - go: {{.DotX}} -{{- end}}{{end -}} -{{- range .GoVersions}}{{if not .MaxVersion}} - - arch: arm64 - go: {{.DotX}} -{{- end}}{{end}} - - os: windows - go: tip - arch: arm64 go: tip before_install: - export GOFLAGS=-mod=vendor - if [ $TRAVIS_OS_NAME = "linux" ]; then sudo apt-get -qq update; sudo apt-get install -y dwz; echo "dwz version $(dwz --version)"; fi - - if [ $TRAVIS_OS_NAME = "windows" ]; then choco install procdump make; fi # 386 linux @@ -146,4 +128,43 @@ cache: os.Exit(1) } _ = out.Flush() + _ = travisfh.Close() + + githubfh, err := os.Create(".github/workflows/test.yml") + if err != nil { + fmt.Fprintf(os.Stderr, "Could not create .github/test.yml: %v", err) + os.Exit(1) + } + out = bufio.NewWriter(githubfh) + err = template.Must(template.New(".github/workflows/test.yml").Parse(`name: Delve CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{"{{"}}matrix.os{{"}}"}} + strategy: + matrix: + include: + - go: {{index .GoVersions 0}} + os: macos-latest + - go: {{index .GoVersions 1}} + os: ubuntu-latest + - go: {{index .GoVersions 2}} + os: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v1 + with: + go-version: ${{"{{"}}matrix.go{{"}}"}} + - run: go run _scripts/make.go test +`)).Execute(out, args) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error executing template: %v", err) + os.Exit(1) + } + + _ = out.Flush() + _ = githubfh.Close() } diff --git a/_scripts/make.go b/_scripts/make.go index dca12f8f..1580bb5c 100644 --- a/_scripts/make.go +++ b/_scripts/make.go @@ -19,6 +19,7 @@ const DelveMainPackagePath = "github.com/go-delve/delve/cmd/dlv" var Verbose bool var NOTimeout bool +var TestIncludePIE bool var TestSet, TestRegex, TestBackend, TestBuildMode string func NewMakeCommands() *cobra.Command { @@ -94,6 +95,7 @@ This option can only be specified if testset is basic or a single package.`) pie PIE buildmode This option can only be specified if testset is basic or a single package.`) + test.PersistentFlags().BoolVarP(&TestIncludePIE, "pie", "", true, "Standard testing should include PIE") RootCommand.AddCommand(test) @@ -332,7 +334,7 @@ func testStandard() { fmt.Println("\nTesting RR backend") testCmdIntl("basic", "", "rr", "normal") } - if runtime.GOOS == "linux" || (runtime.GOOS == "windows" && goversion.VersionAfterOrEqual(runtime.Version(), 1, 15)) { + if TestIncludePIE && (runtime.GOOS == "linux" || (runtime.GOOS == "windows" && goversion.VersionAfterOrEqual(runtime.Version(), 1, 15))) { fmt.Println("\nTesting PIE buildmode, default backend") testCmdIntl("basic", "", "default", "pie") testCmdIntl("core", "", "default", "pie") diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..74035298 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,33 @@ +version: '{build}' +os: Windows Server 2012 R2 +clone_folder: c:\gopath\src\github.com\go-delve\delve +environment: + GOPATH: C:\gopath +install: + ps: | + # Install MinGW. + if (-Not (Test-Path "C:\mingw64")) { + $file = "x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z" + $url = "https://bintray.com/artifact/download/drewwells/generic/" + $url += $file + Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file + &7z x -oC:\ $file > $null + } + # Install Procdump + if (-Not (Test-Path "C:\procdump")) { + mkdir c:\procdump + Invoke-WebRequest -UserAgent wget -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile C:\procdump\procdump.zip + &7z x -oC:\procdump\ C:\procdump\procdump.zip > $null + } + set PATH=c:\procdump;c:\mingw64\bin;%GOPATH%\bin;%PATH% + echo %PATH% + echo %GOPATH% + go version + go env +cache: + C:\mingw64 + C:\procdump +build_script: + mingw32-make install +test_script: + mingw32-make test