forked from elastic/gosigar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
80 lines (70 loc) · 2.64 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Version format
version: "{build}"
# Operating system (build VM template)
os: Windows Server 2012 R2
# Environment variables
environment:
GOVERSION: 1.5.3
GOROOT: c:\go1.5.3
GOPATH: c:\gopath
# Custom clone folder (variables are not expanded here).
clone_folder: c:\gopath\src\github.com\elastic\gosigar
# Cache mingw install until appveyor.yml is modified.
cache:
- C:\ProgramData\chocolatey\bin -> .appveyor.yml
- C:\ProgramData\chocolatey\lib -> .appveyor.yml
- C:\go1.5.3 -> .appveyor.yml
- C:\tools\mingw64 -> .appveyor.yml
# Scripts that run after cloning repository
install:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/elastic/beats/master/libbeat/scripts/install-go.ps1'))
- set PATH=%GOROOT%\bin;%PATH%
# AppVeyor installed mingw is 32-bit only.
- ps: >-
if(!(Test-Path "C:\tools\mingw64\bin\gcc.exe")) {
cinst mingw > mingw-install.txt
Push-AppveyorArtifact mingw-install.txt
}
- set PATH=C:\tools\mingw64\bin;%GOROOT%\bin;%PATH%
- set PATH=%GOPATH%\bin;%PATH%
- set GO15VENDOREXPERIMENT=1
- go version
- go env
- python --version
# To run your custom scripts instead of automatic MSBuild
build_script:
# Compile
- appveyor AddCompilationMessage "Starting Compile"
- cd c:\gopath\src\github.com\elastic\gosigar
- go get -t
- go build
- go build -o examples/df/df.exe ./examples/df
- go build -o examples/free/free.exe ./examples/free
- go build -o examples/ps/ps.exe ./examples/ps
- go build -o examples/uptime/uptime.exe ./examples/uptime
- appveyor AddCompilationMessage "Compile Success"
# To run your custom scripts instead of automatic tests
test_script:
# Unit tests
- ps: Add-AppveyorTest "Unit Tests" -Outcome Running
- mkdir build\coverage
- go test -cover -coverprofile=build\coverage\unit.cov -coverpkg=github.com/elastic/gosigar -v .
- ps: Update-AppveyorTest "Unit Tests" -Outcome Passed
- ps: Add-AppveyorTest "Running Examples" -Outcome Running
- .\examples\df\df.exe
- .\examples\free\free.exe
- .\examples\ps\ps.exe
- .\examples\uptime\uptime.exe
- ps: Update-AppveyorTest "Running Examples" -Outcome Passed
after_test:
- go tool cover -html=build\coverage\unit.cov -o build\coverage\unit.html
- ps: Push-AppveyorArtifact build\coverage\unit.cov
- ps: Push-AppveyorArtifact build\coverage\unit.html
# Upload coverage report.
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -X gcov -f "build\coverage\unit.cov"
# To disable deployment
deploy: off
# Notifications should only be setup using the AppVeyor UI so that
# forks can be created without inheriting the settings.