forked from rizinorg/rizin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.appveyor.yml
More file actions
137 lines (119 loc) · 6.11 KB
/
.appveyor.yml
File metadata and controls
137 lines (119 loc) · 6.11 KB
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
# Version format
version: 'git.{build}'
# Skip Github tags
skip_tags: true
# Environment variables
environment:
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip
VSVARSALLPATH2017: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
VSVARSALLPATH2019: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat'
VSVARSALLPATH2022: 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat'
matrix:
# VS2017 64
- builder: vs2017_64
PYTHON: 'C:\\Python310'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 5'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
RUN_TESTS: false
TEST_INCLUDE_HEADERS_CPP: false
# VS2022 64
- builder: vs2022_64
PYTHON: 'C:\\Python38-x64'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
RUN_TESTS: true
TEST_INCLUDE_HEADERS_CPP: true
# VS2017 64 (Dynamic linking)
- builder: vs2017_64_dyn
PYTHON: 'C:\\Python310'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 5'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
RUN_TESTS: false
TEST_INCLUDE_HEADERS_CPP: false
# Clang-cl 64 (Dynamic linking)
- builder: clang_cl_64_dyn
PYTHON: 'C:\\Python38'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
RUN_TESTS: true
TEST_INCLUDE_HEADERS_CPP: false
only_commits:
files:
- '**/*.c'
- '**/*.h'
- '**/*.in'
- '**/*.inc'
- '**/meson.build'
- 'subprojects/'
- 'test/'
- '.appveyor.yml'
# Init
init:
# Build dependent custom commands
- cmd: "%init_command%"
# Required software for building
install:
# Install Python 3.10
- cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( choco install python310 )
# Update environment variables
- ps: $env:RZ_VERSION = (& (Join-Path $env:PYTHON python.exe) sys\\version.py )
- ps: $env:DIST_FOLDER = "rizin-$env:builder-$env:RZ_VERSION"
- ps: $env:ARTIFACT_ZIP = "$env:DIST_FOLDER.zip"
# Download required packages
- cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( %PYTHON%\python -m pip install --upgrade pip && %PYTHON%\python -m pip install --upgrade certifi pip-system-certs )
- cmd: "%PYTHON%\\python -m pip install meson ninja PyYAML tomli"
- cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( %PYTHON%\python -m pip install meson==1.10.2 )
# Build scripts
build_script:
- appveyor AddMessage "Compiling rizin %RZ_VERSION% (%builder%)"
# Meson patched to work around git network issues
- cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( patch %PYTHON%\Lib\site-packages\mesonbuild\utils\universal.py patches\meson-git-retry.patch )
- cmd: if %builder% == vs2017_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson setup --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2022_64 ( choco install mingw && refreshenv && set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2022%" x64 && %PYTHON%\Scripts\meson setup --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson setup --buildtype=release --prefix="%CD%\%DIST_FOLDER%" build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && set CC=clang-cl && %PYTHON%\Scripts\meson setup --buildtype=release --prefix="%CD%\%DIST_FOLDER%" build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
for:
# Run tests only conditionally
- matrix:
only:
- RUN_TESTS: true
test_script:
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( call "%VSVARSALLPATH2017%" x64 )
- if %builder% == vs2022_64 ( call "%VSVARSALLPATH2022%" x64 )
- if %builder% == clang_cl_64_dyn ( call "%VSVARSALLPATH2019%" x64 )
- set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;C:\Python38-x64;C:\msys64\mingw64\bin;%PATH%
- echo %PATH%
- where rizin
- rizin -v
- copy C:\Python38-x64\python.exe C:\Python38-x64\python3.exe
- python3 -m pip install "git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python"
- python3 -m pip install requests
- cd test
- git clone -q --depth 1 -c core.symlinks=true https://github.com/rizinorg/rizin-testbins bins
- cd ..
- "%PYTHON%\\Scripts\\meson test -C build -t 10 --print-errorlogs"
- cd test
- rz-test -o results.json -e db\esil -L db
- cd ..
# Include header files from C++
- matrix:
only:
- TEST_INCLUDE_HEADERS_CPP: true
test_script:
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( call "%VSVARSALLPATH2017%" x64 )
- if %builder% == vs2022_64 ( call "%VSVARSALLPATH2022%" x64 )
- if %builder% == clang_cl_64_dyn ( call "%VSVARSALLPATH2019%" x64 )
- set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;C:\Python38-x64;C:\msys64\mingw64\bin;%PATH%
- echo %PATH%
- where rizin
- rizin -v
- copy C:\Python38-x64\python.exe C:\Python38-x64\python3.exe
- "%PYTHON%\\Scripts\\meson setup build-cpp-test ./test/unit/cpp"
- "%PYTHON%\\Scripts\\meson compile -C build-cpp-test"
- "%PYTHON%\\Scripts\\meson test -C build-cpp-test --print-errorlogs"
# Artifacts
artifacts:
# Binaries
- path: "%ARTIFACT_ZIP%"
# Test results
- path: test/results.json