-
Notifications
You must be signed in to change notification settings - Fork 152
/
.appveyor.yml
67 lines (50 loc) · 2.18 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
version:
"{build}"
os:
Visual Studio 2019
clone_folder:
C:\grok_exporter
environment:
PATH: C:\go\bin;C:\msys64\mingw64\bin;%PATH%
GOPATH: c:\go
CC: x86_64-w64-mingw32-gcc
CGO_ENABLED: 1
CGO_LDFLAGS: C:\msys64\mingw64\lib\libonig.a
# --------------------------------------------------------------------------
# The install phase installs the Oniguruma library,
# which is a dependency for building grok_exporter.
# We use Cygwin and MinGW to cross-compile Oniguruma for Windows.
# --------------------------------------------------------------------------
install:
# Update the Cygwin environment
# Uncomment the following command to upgrade the cygwin packages:
# - C:\cygwin\setup-x86.exe -q -g
- C:\cygwin64\bin\bash -lc "cygcheck -dc cygwin"
# Download and unpack Oniguruma sources
- cd C:\
- appveyor DownloadFile https://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5-rev1.tar.gz
- 7z x onig-6.9.5-rev1.tar.gz -so | 7z x -si -ttar > nul
- cd onig-6.9.5
# Compile Oniguruma using x86_64-w64-mingw32-gcc
- C:\cygwin64\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./configure -v --host=x86_64-w64-mingw32 --prefix=/cygdrive/c/msys64/mingw64"
- C:\cygwin64\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' make"
- C:\cygwin64\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' make install"
# --------------------------------------------------------------------------
# The build phase compiles and tests grok_exporter.
# --------------------------------------------------------------------------
build_script:
- cd c:\grok_exporter
- git submodule update --init --recursive
- go version
- go test ./...
- go install
- C:\cygwin64\bin\bash -c "cd /cygdrive/c/grok_exporter ; PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./hack/smoke-test.sh"
# Print the linked DLLs, so we can check that grok_exporter does not have
# a runtime dependency on Oniguruma.
- C:\cygwin64\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' x86_64-w64-mingw32-objdump -p /cygdrive/c/go/bin/grok_exporter.exe | grep 'DLL Name:'"
# Success.
- grok_exporter -version
test:
off
deploy:
off