forked from swig/swig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
195 lines (185 loc) · 8.27 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
platform:
- x64
skip_commits:
files:
- '.github/**'
- 'CHANGES*'
- 'Doc/**'
- 'Tools/CI-*'
environment:
global:
MAKEJOBS: 2
matrix:
- SWIGLANG: csharp
VSVER: 12
- SWIGLANG: csharp
VSVER: 14
- SWIGLANG: python
VSVER: 14
VER: 27
PY2: 2
- BUILDSYSTEM: cmake
VSVER: 14
- SWIGLANG: python
VSVER: 15
VER: 38
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- SWIGLANG: python
VSVER: 16
VER: 39
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- SWIGLANG: csharp
VSVER: 17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: csharp
VSVER: 17
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: java
VSVER: 17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: java
VSVER: 17
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: python
VSVER: 17
VER: 310
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: python
VSVER: 17
VER: 310
Platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: python
OSVARIANT: cygwin
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: java
OSVARIANT: mingw
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- SWIGLANG: python
OSVARIANT: mingw
WITHLANG: python
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
#matrix:
# allow_failures:
# - SWIGLANG: python
# OSVARIANT: cygwin
# Skip stale commits (pull requests only), see https://github.com/appveyor/ci/issues/38#issuecomment-70628826
init:
- ps: |
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
install:
- date /T & time /T
- ps: >-
if ($env:Platform -eq "x86") {
$env:PCRE_PLATFORM="Win32"
$env:JAVA_HOME="C:/Program Files (x86)/Java/jdk1.8.0"
$env:VCVARS_PLATFORM="x86"
$env:LANG_PLATFORM=""
$env:CYGWINBIN="C:\cygwin\bin"
$env:CYGWINSETUP="C:/cygwin/setup-x86.exe"
$env:MSYSBIN="C:\msys64\usr\bin"
$env:MINGWBIN="C:\msys64\mingw32\bin"
$env:MBITS="32"
$env:MARCH="i686"
$env:VSARCH=""
} else {
$env:PCRE_PLATFORM="x64"
$env:JAVA_HOME="C:/Program Files/Java/jdk17"
$env:VCVARS_PLATFORM="amd64"
$env:LANG_PLATFORM="-x64"
$env:CYGWINBIN="C:\cygwin64\bin"
$env:CYGWINSETUP="C:/cygwin64/setup-x86_64.exe"
$env:MSYSBIN="C:\msys64\usr\bin"
$env:MINGWBIN="C:\msys64\mingw64\bin"
$env:MBITS="64"
$env:MARCH="x86_64"
$env:VSARCH=" Win64"
}
- ps: >-
if (!$env:OSVARIANT) {
$env:PATH="$env:CYGWINBIN;$env:PATH"
$env:CYGWIN="nodosfilewarning"
$env:CC="cccl"
$env:CXX="cccl"
if ($env:VSVER -ge 17) {
$env:VCVARSBAT="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars$env:MBITS.bat"
$env:BOOSTROOT="C:/Libraries/boost_1_77_0"
} elseif ($env:VSVER -eq 16) {
$env:VCVARSBAT="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars$env:MBITS.bat"
$env:BOOSTROOT="C:/Libraries/boost_1_73_0"
} elseif ($env:VSVER -eq 15) {
$env:VCVARSBAT="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars$env:MBITS.bat"
$env:BOOSTROOT="C:/Libraries/boost_1_69_0"
} else {
$env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
$env:VCVARSBAT="$env:VSCOMNTOOLS..\..\VC\vcvarsall.bat"
$env:VCVARSARG="$env:VCVARS_PLATFORM"
$env:BOOSTROOT="C:/Libraries/boost_1_69_0"
}
} elseif ($env:OSVARIANT -eq "cygwin") {
$env:PATH="$env:CYGWINBIN;$env:PATH"
$env:CYGWIN="nodosfilewarning"
$env:CC="gcc"
$env:CXX="g++"
} elseif ($env:OSVARIANT -eq "mingw") {
# Note mingw setup tests the native Windows Python distribution (not MinGW Python) with gcc
$env:PATH="$env:MINGWBIN;$env:MSYSBIN;$env:PATH"
$env:MSYSTEM="MINGW$env:MBITS" # This is important for msys2
$env:CC="gcc"
$env:CXX="g++"
}
- if "%OSVARIANT%"=="" bash -c "cd /usr/bin && curl --retry 15 -s -L https://github.com/swig/cccl/archive/cccl-1.2.tar.gz | tar -xz --strip 1 cccl-cccl-1.2/cccl"
- if "%OSVARIANT%"=="" call "%VCVARSBAT%" %VCVARSARG%
- if "%OSVARIANT%"=="" appveyor-retry appveyor DownloadFile https://github.com/PhilipHazel/pcre2/archive/refs/tags/pcre2-10.39.zip
- if "%OSVARIANT%"=="" 7z x pcre2-10.39.zip
- if "%OSVARIANT%"=="" set PCRE_ROOT=C:/pcre
- if "%OSVARIANT%"=="" set PATH=C:\Python%VER%%LANG_PLATFORM%;%PATH%
- if "%OSVARIANT%"=="" bash -c "which cl.exe"
- if "%OSVARIANT%"=="" bash -c "cl.exe /? 2>&1 | head -n 1"
- if "%OSVARIANT%"=="" bash -c "which csc.exe"
- if "%OSVARIANT%"=="" bash -c "csc.exe /? | head -n 1"
- if "%OSVARIANT%"=="cygwin" %CYGWINSETUP% --quiet-mode --packages python3-devel,libpcre2-devel,libboost-devel > cygwin-install.txt || bash -c "cat cygwin-install.txt"
- if "%OSVARIANT%"=="mingw" bash -c "pacman --noconfirm --sync mingw%MBITS%/mingw-w64-%MARCH%-autotools mingw%MBITS%/mingw-w64-%MARCH%-pcre2 mingw%MBITS%/mingw-w64-%MARCH%-boost mingw%MBITS%/mingw-w64-%MARCH%-python"
- if not "%WITHLANG%"=="" set SWIGWITHLANG==%WITHLANG%
- if not "%WITHLANG%"=="" where %WITHLANG%
- if "%SWIGLANG%"=="python" set PY3=3
- if "%PY2%"=="2" set PY3=
- bash -c "which $CC"
- bash -c "which $CXX"
- bash -c "$CC --version | head -n 1"
- bash -c "$CXX --version | head -n 1"
- bash -c "which python"
- bash -c "python -V"
- bash -c "make --version | head -n 2"
- pwd
- echo MAKEJOBS=%MAKEJOBS%
- uname -a
build_script:
- set CCCL_OPTIONS=--cccl-muffle /W3 /EHsc
- set CHECK_OPTIONS=CSHARPOPTIONS=-platform:%Platform%
- if "%BUILDSYSTEM%"=="cmake" cd pcre2-pcre2-10.39 && cmake -G "Visual Studio 14 2015%VSARCH%" -DCMAKE_INSTALL_PREFIX="%PCRE_ROOT:\=/%" . && cmake --build . --config Release --target install && cd ..
- if "%BUILDSYSTEM%"=="cmake" cmake --version && cmake -G "Visual Studio 14 2015%VSARCH%" -DCMAKE_INSTALL_PREFIX="%CD:\=/%/install2" -DCMAKE_C_FLAGS="/WX /DPCRE2_STATIC" -DCMAKE_CXX_FLAGS="/WX /DPCRE2_STATIC" -DPCRE2_INCLUDE_DIR=%PCRE_ROOT%/include -DPCRE2_LIBRARY=%PCRE_ROOT%/lib/pcre2-8-static.lib -DBISON_EXECUTABLE=C:/cygwin/bin/bison.exe . && cmake --build . --config Release --target install && ctest --output-on-failure -V -C Release && appveyor exit
- if "%OSVARIANT%"=="" bash -c "exec 0</dev/null && cd pcre2-pcre2-10.39 && ./autogen.sh && ./configure CC=$CC CXX=$CXX CFLAGS='-O2' LDFLAGS='--cccl-link /LTCG' --prefix=%PCRE_ROOT% --disable-shared && time make -s -j%MAKEJOBS% LN_S=cp && make install && cd .. && cp -v %PCRE_ROOT%/lib/libpcre2-8.lib %PCRE_ROOT%/lib/pcre2-8.lib"
# Open dummy file descriptor to fix error on cygwin: ./configure: line 560: 0: Bad file descriptor
- if "%OSVARIANT%"=="" bash -c "exec 0</dev/null && ./autogen.sh && time ./configure --disable-dependency-tracking --disable-ccache CC=$CC CXX=$CXX CFLAGS='-O2' CXXFLAGS='-O2' LDFLAGS='--cccl-link /LTCG' PCRE2_CFLAGS='-I%PCRE_ROOT%/include -DPCRE2_STATIC' PCRE2_LIBS='-L%PCRE_ROOT%/lib/ -lpcre2-8' --without-perl5 --without-go --with-boost=%BOOSTROOT% || cat config.log"
- if not "%OSVARIANT%"=="" bash -c "exec 0</dev/null && ./autogen.sh && time ./configure CC=%CC% CXX=%CXX% --without-alllang --with-$SWIGLANG$PY3$SWIGWITHLANG || cat config.log"
- bash -c "time make -s -j%MAKEJOBS%"
test_script:
- set CCCL_OPTIONS=--cccl-muffle /W3 /EHsc
- .\swig.exe -version
- .\swig.exe -pcreversion
- if not "%OSVARIANT%"=="" CCache\ccache-swig -V
- bash -c "file ./swig.exe"
- bash -c "make check-%SWIGLANG%-version"
- bash -c "make check-%SWIGLANG%-enabled"
- bash -c "time make -k check-%SWIGLANG%-examples %CHECK_OPTIONS% %CHECK_OPTIONS2%"
- bash -c "time make -k check-%SWIGLANG%-test-suite -j%MAKEJOBS% %CHECK_OPTIONS% %CHECK_OPTIONS2%"
# Do not build on tags (GitHub only)
skip_tags: true
#on_finish: # Display RDP connection information
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))