Skip to content

Commit

Permalink
update appveyor build
Browse files Browse the repository at this point in the history
  • Loading branch information
fstab committed Sep 22, 2020
1 parent 2eca0d8 commit 9a9c6da
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version:
"{build}"

os:
Windows Server 2012 R2
Visual Studio 2019

clone_folder:
C:\grok_exporter
Expand All @@ -13,8 +13,6 @@ environment:
CC: x86_64-w64-mingw32-gcc
CGO_ENABLED: 1
CGO_LDFLAGS: C:\msys64\mingw64\lib\libonig.a
matrix:
- ONIG_VERSION: 6.9.4

# --------------------------------------------------------------------------
# The install phase installs the Oniguruma library,
Expand All @@ -28,20 +26,20 @@ install:

# Uncomment the following command to upgrade the cygwin packages:
# - C:\cygwin\setup-x86.exe -q -g
- C:\cygwin\bin\bash -lc "cygcheck -dc cygwin"
- C:\cygwin64\bin\bash -lc "cygcheck -dc cygwin"

# Download and unpack Oniguruma sources

- cd C:\
- appveyor DownloadFile https://github.com/kkos/oniguruma/releases/download/v%ONIG_VERSION%/onig-%ONIG_VERSION%.tar.gz
- 7z x onig-%ONIG_VERSION%.tar.gz -so | 7z x -si -ttar > nul
- cd onig-%ONIG_VERSION%
- 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:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./configure -v --host=x86_64-w64-mingw32 --prefix=/cygdrive/c/msys64/mingw64"
- C:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' make"
- C:\cygwin\bin\bash -c "PATH='/usr/sbin:/usr/bin:/sbin:/bin' make install"
- 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.
Expand All @@ -50,15 +48,14 @@ install:
build_script:
- cd c:\grok_exporter
- git submodule update --init --recursive
- set GO111MODULE=on
- go version
- go test ./...
- go install
- C:\cygwin\bin\bash -c "cd /cygdrive/c/grok_exporter ; PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./hack/smoke-test.sh"
- 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:\cygwin\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:'"
- 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
Expand Down

0 comments on commit 9a9c6da

Please sign in to comment.