forked from Unity-Technologies/crunch
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/azure: test build on Linux, MinGW and macOS
- Loading branch information
Showing
1 changed file
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# 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/ | ||
- cmake/ | ||
- CMakeLists.txt | ||
|
||
strategy: | ||
matrix: | ||
Linux GCC: | ||
VM_IMAGE: 'ubuntu-20.04' | ||
CMAKE_GENERATOR: Ninja | ||
C_COMPILER: gcc-8 | ||
CXX_COMPILER: g++-8 | ||
APT_PACKAGES: ninja-build gcc-8 g++-8 | ||
NPROC_TOOL: nproc | ||
BUILD_EXAMPLES: OFF | ||
Linux Clang: | ||
VM_IMAGE: 'ubuntu-20.04' | ||
CMAKE_GENERATOR: Ninja | ||
C_COMPILER: clang | ||
CXX_COMPILER: clang++ | ||
APT_PACKAGES: ninja-build gcc-8 g++-8 | ||
NPROC_TOOL: nproc | ||
BUILD_EXAMPLES: OFF | ||
MinGW amd64: | ||
VM_IMAGE: 'ubuntu-20.04' | ||
CMAKE_GENERATOR: Ninja | ||
C_COMPILER: x86_64-w64-mingw32-gcc | ||
CXX_COMPILER: x86_64-w64-mingw32-g++ | ||
TOOLCHAIN_FILE: cmake/cross-toolchain-mingw64.cmake | ||
INSTALL_TOOL: apt | ||
APT_PACKAGES: ninja-build gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-x86-64-dev | ||
SETUP_COMMANDS: sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix ; sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix | ||
NPROC_TOOL: nproc | ||
BUILD_EXAMPLES: ON | ||
MinGW i686: | ||
VM_IMAGE: 'ubuntu-20.04' | ||
CMAKE_GENERATOR: Ninja | ||
C_COMPILER: i686-w64-mingw32-gcc | ||
CXX_COMPILER: i686-w64-mingw32-g++ | ||
TOOLCHAIN_FILE: cmake/cross-toolchain-mingw32.cmake | ||
INSTALL_TOOL: apt | ||
APT_PACKAGES: ninja-build gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-i686-dev | ||
SETUP_COMMANDS: sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix ; sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix | ||
NPROC_TOOL: nproc | ||
BUILD_EXAMPLES: ON | ||
Mac: | ||
VM_IMAGE: 'macOS-12' | ||
CMAKE_GENERATOR: Unix Makefiles | ||
C_COMPILER: clang | ||
CXX_COMPILER: clang++ | ||
NPROC_TOOL: sysctl -n hw.logicalcpu | ||
BUILD_EXAMPLES: OFF | ||
|
||
pool: | ||
vmImage: $(VM_IMAGE) | ||
|
||
steps: | ||
- bash: | | ||
set -xe | ||
if [ -n "${APT_PACKAGES:-}" ]; then | ||
sudo apt-get update && sudo apt-get -y -q --no-install-recommends install ${APT_PACKAGES} | ||
fi | ||
if [ -n "${SETUP_COMMANDS:-}" ]; then | ||
$(SETUP_COMMANDS) | ||
fi | ||
displayName: 'Setup' | ||
- bash: | | ||
set -xe | ||
export CMAKE_BUILD_PARALLEL_LEVEL="$(${NPROC_TOOL})" | ||
echo "${CMAKE_BUILD_PARALLEL_LEVEL}" | ||
cmake -S. -Bbuild \ | ||
-G"${CMAKE_GENERATOR}" \ | ||
-DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \ | ||
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \ | ||
-DBUILD_CRUNCH=ON -DBUILD_SHARED_LIBCRN=ON -DBUILD_EXAMPLES=${BUILD_EXAMPLES} | ||
cmake --build build --config Release | ||
displayName: 'Build' |