.appveyor.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Version format
  2. version: "{build}"
  3. # Operating system (build VM template)
  4. os: Windows Server 2012 R2
  5. # Environment variables
  6. environment:
  7. GOPATH: c:\gopath
  8. GVM_GO_VERSION: 1.8.3
  9. GVM_DL: https://github.com/andrewkroh/gvm/releases/download/v0.0.1/gvm-windows-amd64.exe
  10. # Custom clone folder (variables are not expanded here).
  11. clone_folder: c:\gopath\src\github.com\elastic\gosigar
  12. # Cache mingw install until appveyor.yml is modified.
  13. cache:
  14. - C:\ProgramData\chocolatey\bin -> .appveyor.yml
  15. - C:\ProgramData\chocolatey\lib -> .appveyor.yml
  16. - C:\Users\appveyor\.gvm -> .appveyor.yml
  17. - C:\Windows\System32\gvm.exe -> .appveyor.yml
  18. - C:\tools\mingw64 -> .appveyor.yml
  19. # Scripts that run after cloning repository
  20. install:
  21. - ps: >-
  22. if(!(Test-Path "C:\Windows\System32\gvm.exe")) {
  23. wget "$env:GVM_DL" -Outfile C:\Windows\System32\gvm.exe
  24. }
  25. - ps: gvm --format=powershell "$env:GVM_GO_VERSION" | Invoke-Expression
  26. # AppVeyor installed mingw is 32-bit only so install 64-bit version.
  27. - ps: >-
  28. if(!(Test-Path "C:\tools\mingw64\bin\gcc.exe")) {
  29. cinst mingw > mingw-install.txt
  30. Push-AppveyorArtifact mingw-install.txt
  31. }
  32. - set PATH=C:\tools\mingw64\bin;%GOROOT%\bin;%PATH%
  33. - set PATH=%GOPATH%\bin;%PATH%
  34. - go version
  35. - go env
  36. - python --version
  37. - go get github.com/elastic/beats/vendor/github.com/pierrre/gotestcover
  38. # To run your custom scripts instead of automatic MSBuild
  39. build_script:
  40. # Compile
  41. - appveyor AddCompilationMessage "Starting Compile"
  42. - cd c:\gopath\src\github.com\elastic\gosigar
  43. - go get -v -t -d ./...
  44. - go build
  45. - go build -o examples/df/df.exe ./examples/df
  46. - go build -o examples/free/free.exe ./examples/free
  47. - go build -o examples/ps/ps.exe ./examples/ps
  48. - go build -o examples/uptime/uptime.exe ./examples/uptime
  49. - appveyor AddCompilationMessage "Compile Success"
  50. # To run your custom scripts instead of automatic tests
  51. test_script:
  52. # Unit tests
  53. - ps: Add-AppveyorTest "Unit Tests" -Outcome Running
  54. - mkdir build\coverage
  55. - gotestcover -v -coverprofile=build/coverage/unit.cov github.com/elastic/gosigar/...
  56. - ps: Update-AppveyorTest "Unit Tests" -Outcome Passed
  57. - ps: Add-AppveyorTest "Running Examples" -Outcome Running
  58. - .\examples\df\df.exe
  59. - .\examples\free\free.exe
  60. - .\examples\ps\ps.exe
  61. - .\examples\uptime\uptime.exe
  62. - ps: Update-AppveyorTest "Running Examples" -Outcome Passed
  63. after_test:
  64. - go tool cover -html=build\coverage\unit.cov -o build\coverage\unit.html
  65. - ps: Push-AppveyorArtifact build\coverage\unit.cov
  66. - ps: Push-AppveyorArtifact build\coverage\unit.html
  67. # Upload coverage report.
  68. - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
  69. - pip install codecov
  70. - codecov -X gcov -f "build\coverage\unit.cov"
  71. # To disable deployment
  72. deploy: off
  73. # Notifications should only be setup using the AppVeyor UI so that
  74. # forks can be created without inheriting the settings.