forked from Unity-Technologies/crunch
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.azure-pipelines.yml
144 lines (139 loc) · 4.93 KB
/
.azure-pipelines.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
# Documentation: https://wiki.unvanquished.net/wiki/Continuous_integration
trigger:
branches:
include:
- master
pr:
branches:
include:
- '*'
paths:
include:
- .azure-pipelines.yml
# The rest of this list should stay in sync with .appveyor.yml
- crunch/
- crnlib/
- inc/
- example1/
- example2/
- example3/
- test/
- cmake/
- CMakeLists.txt
strategy:
matrix:
Linux amd64 GCC:
VM_IMAGE: 'ubuntu-20.04'
APT_PACKAGES: ninja-build g++-8
CXX_COMPILER: g++-8
Linux i686 GCC:
VM_IMAGE: 'ubuntu-20.04'
APT_PACKAGES: ninja-build g++-i686-linux-gnu
CXX_COMPILER: i686-linux-gnu-g++
COMPILER_FLAGS: -mfpmath=sse -msse
Linux arm64 GCC:
VM_IMAGE: 'ubuntu-20.04'
APT_PACKAGES: ninja-build g++-aarch64-linux-gnu qemu-user
CXX_COMPILER: aarch64-linux-gnu-g++
CRUNCH_EXE_RUNNER: qemu-aarch64 -L /usr/aarch64-linux-gnu
Linux armhf GCC:
VM_IMAGE: 'ubuntu-20.04'
APT_PACKAGES: ninja-build g++-arm-linux-gnueabihf qemu-user
CXX_COMPILER: arm-linux-gnueabihf-g++
CRUNCH_EXE_RUNNER: qemu-arm -L /usr/arm-linux-gnueabihf
# There is a qemu-arm IO bug in ubuntu-20.04 and ubuntu-22.04,
# remove when ubuntu-24.04 is available.
CRUNCH_SIMPLE_TEST: true
Linux amd64 Clang:
VM_IMAGE: 'ubuntu-20.04'
APT_PACKAGES: ninja-build
CXX_COMPILER: clang++
Windows amd64 MinGW:
VM_IMAGE: 'ubuntu-22.04'
APT_PACKAGES: ninja-build g++-mingw-w64-x86-64 mingw-w64-x86-64-dev gcc-mingw-w64-x86-64-posix-runtime wine
SETUP_COMMANDS: sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
TOOLCHAIN_FILE: cmake/cross-toolchain-mingw64.cmake
CRUNCH_EXE_RUNNER: wine
CRUNCH_EXTENSION: .exe
RUNTIME_FILES: /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libgcc_s_seh-1.dll /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libstdc++-6.dll /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll
Windows i686 MinGW:
VM_IMAGE: 'ubuntu-22.04'
APT_ARCHITECTURE: i386
APT_PACKAGES: ninja-build g++-mingw-w64-i686 mingw-w64-i686-dev gcc-mingw-w64-i686-posix-runtime wine wine32
SETUP_COMMANDS: sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
TOOLCHAIN_FILE: cmake/cross-toolchain-mingw32.cmake
COMPILER_FLAGS: -mfpmath=sse -msse
CRUNCH_EXE_RUNNER: wine
CRUNCH_EXTENSION: .exe
RUNTIME_FILES: /usr/lib/gcc/i686-w64-mingw32/10-posix/libgcc_s_dw2-1.dll /usr/lib/gcc/i686-w64-mingw32/10-posix/libstdc++-6.dll /usr/i686-w64-mingw32/lib/libwinpthread-1.dll
macOS amd64 AppleClang:
VM_IMAGE: 'macOS-12'
PIP_PACKAGES: colorama
CMAKE_GENERATOR: Unix Makefiles
NPROC_COMMAND: sysctl -n hw.logicalcpu
macOS arm64 AppleClang:
VM_IMAGE: 'macOS-12'
PIP_PACKAGES: colorama
CMAKE_GENERATOR: Unix Makefiles
COMPILER_FLAGS: -target arm64-apple-macos11 -Wno-overriding-t-option
NPROC_COMMAND: sysctl -n hw.logicalcpu
RUN_TESTS: false
Web Asm.js Emscripten:
VM_IMAGE: 'ubuntu-22.04'
APT_PACKAGES: ninja-build emscripten
TOOLCHAIN_FILE: /usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake
SOURCE_DIR: emscripten
EXECUTABLES: crunch.js crunch.wasm
RUN_TESTS: false
pool:
vmImage: $(VM_IMAGE)
steps:
- bash: |
set -xue
if [ -n "${APT_ARCHITECTURE:-}" ]; then
sudo dpkg --add-architecture "${APT_ARCHITECTURE}"
fi
if [ -n "${APT_PACKAGES:-}" ]; then
sudo apt-get update && sudo apt-get -y -q --no-install-recommends install ${APT_PACKAGES}
fi
if [ -n "${PIP_PACKAGES:-}" ]; then
pip install ${PIP_PACKAGES}
fi
if [ -n "${SETUP_COMMANDS:-}" ]; then
$(SETUP_COMMANDS)
fi
displayName: 'Setup'
- bash: |
set -xue
export CMAKE_BUILD_PARALLEL_LEVEL="$(${NPROC_COMMAND:-nproc})"
echo "${CMAKE_BUILD_PARALLEL_LEVEL}"
cmake_args=(-G"${CMAKE_GENERATOR:-Ninja}")
if [ -n "${TOOLCHAIN_FILE:-}" ]; then
cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}")
fi
if [ -n "${CXX_COMPILER:-}" ]; then
cmake_args+=(-DCMAKE_CXX_COMPILER="${CXX_COMPILER}")
fi
if [ -n "${COMPILER_FLAGS:-}" ]; then
cmake_args+=(-DCMAKE_CXX_FLAGS="${COMPILER_FLAGS}")
fi
if [ -z "${SOURCE_DIR:-}" ]; then
cmake_args+=(-DBUILD_CRUNCH=ON -DBUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON)
fi
cmake_args+=(-DUSE_FAST_MATH=OFF)
cmake -S"${SOURCE_DIR:-.}" -Bbuild "${cmake_args[@]}"
cmake --build build --config Release
displayName: 'Build'
- bash: |
set -xue
EXECUTABLES="${EXECUTABLES:-crunch example1 example2 example3}"
for exe_file in ${EXECUTABLES}; do
file 'build/${exe_file}${CRUNCH_EXTENSION:-}'
done
if [ -n "${RUNTIME_FILES:-}" ]; then
cp -av ${RUNTIME_FILES} build/
fi
if "${RUN_TESTS:-true}"; then
test/test.py
fi
displayName: 'Test'