forked from systerel/S2OPC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
168 lines (153 loc) · 8.35 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
environment:
matrix:
- PYTHON: "C:\\Python39-x64"
image:
- Visual Studio 2022
install:
- set ROOT_DIR=%APPVEYOR_BUILD_FOLDER%
- cd %ROOT_DIR%
# Prepend chosen Python to the PATH of this build
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- "pip --version"
- "python.exe -m pip install -U pip setuptools build wheel"
- "pip install wexpect==4.0.0 cryptography pycparser six==1.11.0 asn1crypto==0.23.0 click cython python_dateutil==2.6.1 argparse==1.4.0 pytz==2017.2 idna==2.6 lxml"
- set FREEOPCUA_DIR_NAME=python-opcua-0.98.13
- "appveyor.exe DownloadFile https://github.com/FreeOpcUa/python-opcua/archive/refs/tags/0.98.13.zip -FileName %FREEOPCUA_DIR_NAME%.zip"
- "unzip %FREEOPCUA_DIR_NAME%.zip"
# Patch free opcua server
- cd %FREEOPCUA_DIR_NAME%
- ps: (get-content opcua/server/internal_server.py) | %{$_ -replace "result.MaxRequestMessageSize =.*","result.MaxRequestMessageSize = 65536 * 10"} | set-content opcua/server/internal_server.py
- python setup.py install
- cd %ROOT_DIR%
- set AUTOPXD2_DIR_NAME=python-autopxd2-2.3.0
- "appveyor.exe DownloadFile https://github.com/elijahr/python-autopxd2/archive/refs/tags/v2.3.0.zip -FileName %AUTOPXD2_DIR_NAME%.zip"
- "unzip %AUTOPXD2_DIR_NAME%.zip"
# Patch autopxd2
- cd %AUTOPXD2_DIR_NAME%
# C11 atomic types in _fake_typedefs.h of pycparser are not supported, retrieve previous version of the file in pycparser project
- ps: (get-content setup.py) | %{$_ -replace 'commit = .*','commit = "a5e1958d4ab975057e0ce5358d1ac0329bb0cf74"'} | set-content setup.py
# It seems that the autopxd mechanism to find the cl compiler has a bug, fix it
- ps: (get-content autopxd/__init__.py) | %{$_ -replace '"-latest",','"-latest", "-products", "*",'} | set-content autopxd/__init__.py
- python setup.py install
test_script:
- echo %APPVEYOR_BUILD_FOLDER%
- cd %APPVEYOR_BUILD_FOLDER%
- set ROOT_DIR=%APPVEYOR_BUILD_FOLDER%
- set CHECK_DIR_NAME=check-0.14.0
- set CHECK_DIR=%ROOT_DIR%\%CHECK_DIR_NAME%
- set CHECK_BUILD_DIR=%CHECK_DIR%\build
- set MBEDTLS_VERSION=3.6.2
- set MBEDTLS_DIR_NAME=mbedtls-%MBEDTLS_VERSION%
- set MBEDTLS_DIR=%ROOT_DIR%\%MBEDTLS_DIR_NAME%
- set MBEDTLS_BUILD_DIR=%MBEDTLS_DIR%\build
- set EXPAT_DIR_NAME=expat-2.6.4
- set EXPAT_FILE_NAME=R_2_6_4
- set EXPAT_DIR=%ROOT_DIR%\libexpat-%EXPAT_FILE_NAME%\expat
- set EXPAT_INSTALL_DIR=%EXPAT_DIR%\install
- set S2OPC_CLIENTSERVER_ONLY=1
- set S2OPC_EVENT_MANAGEMENT=1
- set CONFIG=RelWithDebInfo
- set LIBS_DIRS=%CHECK_BUILD_DIR%;%EXPAT_INSTALL_DIR%
- set AUTOPXD2_DIR_NAME=python-autopxd2-2.3.0
- set PYS2OPC_VERSION=pys2opc-1.6.0
- set PYS2OPC_WHEEL_NAME=%PYS2OPC_VERSION%-cp39-cp39-win_amd64.whl
- set VS_VERSION="Visual Studio 17 2022"
- set ENABLE_SAMPLES=on
- set TEST_PASSWORD_PRIVATE_KEY=password
- set TEST_PASSWORD_CACERT=S2OPC
- set TEST_PASSWORD_USER_ME=1234
- set TEST_USERNAME=user1
- set TEST_PASSWORD_USER=password
- set TEST_CLIENT_XML_CONFIG=S2OPC_Client_Test_Config.xml
# download and extract libcheck
- cd %ROOT_DIR%
- "appveyor.exe DownloadFile https://github.com/libcheck/check/archive/0.14.0.zip -FileName %CHECK_DIR_NAME%.zip"
- "unzip %CHECK_DIR_NAME%.zip"
# download and extract mbedtls
- cd %ROOT_DIR%
- "appveyor.exe DownloadFile https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-%MBEDTLS_VERSION%/mbedtls-%MBEDTLS_VERSION%.tar.bz2 -FileName %MBEDTLS_DIR_NAME%.tar.bz2"
- "tar -jxvf %MBEDTLS_DIR_NAME%.tar.bz2"
# download and extractbuild expat
- cd %ROOT_DIR%
- "appveyor.exe DownloadFile https://github.com/libexpat/libexpat/archive/refs/tags/%EXPAT_FILE_NAME%.zip -FileName %EXPAT_DIR_NAME%.zip"
- "unzip %EXPAT_DIR_NAME%.zip"
# configure, build dependencies and build S2OPC project as shared DLL
- cd %ROOT_DIR%
- .\build_s2opc.bat
- cd %ROOT_DIR%
- move build build_dll
# Builds with PyS2OPC and tests:
- set WITH_PYS2OPC=1
- set BUILD_SHARED_LIBS=off
- set ENABLE_TESTING=on
# configure, build S2OPC project as static library for tests and for building PyS2OPC
- |-
cd %ROOT_DIR%
mkdir build
cd build
mkdir lib
copy %MBEDTLS_DIR%\build\library\%CONFIG%\mbedtls.lib lib
copy %MBEDTLS_DIR%\build\library\%CONFIG%\mbedx509.lib lib
copy %MBEDTLS_DIR%\build\library\%CONFIG%\mbedcrypto.lib lib
copy %EXPAT_INSTALL_DIR%\lib\libexpatMD.lib lib\libexpat.lib
cd %ROOT_DIR%
.\build_s2opc.bat
- cd %ROOT_DIR%\build\tests\ClientServer
- "ctest -T test -C %CONFIG% --no-compress-output --test-output-size-passed 65536 --test-output-size-failed 65536 -V -E pys2opc*"
- cd %ROOT_DIR%\build\samples\ClientServer
- "ctest -T test -C %CONFIG% --no-compress-output --test-output-size-passed 65536 --test-output-size-failed 65536 -V"
- |-
set PYTHON="C:\\Python310-x64"
set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
set PYS2OPC_WHEEL_NAME=%PYS2OPC_VERSION%-cp310-cp310-win_amd64.whl
pip --version
pip install --upgrade wheel pycparser click cython setuptools build
cd %ROOT_DIR%\%AUTOPXD2_DIR_NAME%
python setup.py install
cd %ROOT_DIR%\build
rm CMakeCache.txt
cmake -DWITH_PYS2OPC=%WITH_PYS2OPC% -DPYS2OPC_WHEEL_NAME=%PYS2OPC_WHEEL_NAME% -DS2OPC_CLIENTSERVER_ONLY=%S2OPC_CLIENTSERVER_ONLY% -DMBEDTLS_INCLUDE_DIR=%MBEDTLS_BUILD_DIR%/../include -DMBEDTLS_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedtls.lib -DMBEDX509_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedx509.lib -DMBEDCRYPTO_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedcrypto.lib -DCMAKE_PREFIX_PATH=%LIBS_DIRS% -DPYTHON_EXECUTABLE=%PYTHON%\python.exe .. -G %VS_VERSION%
cmake --build . --target pys2opc_wheel --config %CONFIG%
- |-
set PYTHON="C:\\Python311-x64"
set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
set PYS2OPC_WHEEL_NAME=%PYS2OPC_VERSION%-cp311-cp311-win_amd64.whl
pip --version
pip install --upgrade wheel pycparser click cython setuptools build
cd %ROOT_DIR%\%AUTOPXD2_DIR_NAME%
python setup.py install
cd %ROOT_DIR%\build
rm CMakeCache.txt
cmake -DWITH_PYS2OPC=%WITH_PYS2OPC% -DPYS2OPC_WHEEL_NAME=%PYS2OPC_WHEEL_NAME% -DS2OPC_CLIENTSERVER_ONLY=%S2OPC_CLIENTSERVER_ONLY% -DMBEDTLS_INCLUDE_DIR=%MBEDTLS_BUILD_DIR%/../include -DMBEDTLS_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedtls.lib -DMBEDX509_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedx509.lib -DMBEDCRYPTO_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedcrypto.lib -DCMAKE_PREFIX_PATH=%LIBS_DIRS% -DPYTHON_EXECUTABLE=%PYTHON%\python.exe .. -G %VS_VERSION%
cmake --build . --target pys2opc_wheel --config %CONFIG%
- |-
set PYTHON="C:\\Python312-x64"
set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
set PYS2OPC_WHEEL_NAME=%PYS2OPC_VERSION%-cp312-cp312-win_amd64.whl
pip --version
pip install --upgrade wheel pycparser click cython setuptools build
cd %ROOT_DIR%\%AUTOPXD2_DIR_NAME%
python setup.py install
cd %ROOT_DIR%\build
rm CMakeCache.txt
cmake -DWITH_PYS2OPC=%WITH_PYS2OPC% -DPYS2OPC_WHEEL_NAME=%PYS2OPC_WHEEL_NAME% -DS2OPC_CLIENTSERVER_ONLY=%S2OPC_CLIENTSERVER_ONLY% -DMBEDTLS_INCLUDE_DIR=%MBEDTLS_BUILD_DIR%/../include -DMBEDTLS_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedtls.lib -DMBEDX509_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedx509.lib -DMBEDCRYPTO_LIBRARY=%MBEDTLS_BUILD_DIR%/library/%CONFIG%/mbedcrypto.lib -DCMAKE_PREFIX_PATH=%LIBS_DIRS% -DPYTHON_EXECUTABLE=%PYTHON%\python.exe .. -G %VS_VERSION%
cmake --build . --target pys2opc_wheel --config %CONFIG%
build: off
artifacts:
- path: build\bin
name: Binaries
type: zip
- path: build\lib
name: Libraries
type: zip
- path: build_dll
name: DLL_build
type: zip
on_failure:
- ps: |-
Compress-Archive -DestinationPath "build.zip" -Path $Env:APPVEYOR_BUILD_FOLDER\build
Push-AppveyorArtifact "build.zip" -FileName "build.zip" -DeploymentName to-publish
# Note: uncomment for CI debug with RDP
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))