forked from Unvanquished/Unvanquished
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
84 lines (78 loc) · 3.9 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
# Documentation: https://wiki.unvanquished.net/wiki/Continuous_integration
trigger:
branches:
include:
- master
- 'for-*.*.*/sync' # Next-release branch
pr:
branches:
include:
- '*'
paths:
include:
- azure-pipelines.yml
# The rest of this list should stay in sync with .appveyor.yml
- daemon/
- libs/
- src/
- .gitmodules
- CMakeLists.txt
- '*.cmake'
- macosx/
- tools/cbse/
strategy:
matrix:
Linux GCC Native DLL:
VM_IMAGE: 'ubuntu-20.04'
INSTALL_DEPS: 'sudo apt-get update && sudo apt-get -y -q --no-install-recommends install libfreetype6-dev liblua5.2-dev python-yaml python-jinja2 ninja-build gcc-8 g++-8'
CMAKE_OPTIONS: '-G Ninja -DCBSE_PYTHON_PATH=/usr/bin/python2 -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DBUILD_GAME_NATIVE_DLL=1 -DBUILD_GAME_NATIVE_EXE=0 -DBUILD_GAME_NACL=0'
BUILDER_OPTIONS: '-j$(nproc) -k 10'
Linux Clang Native DLL:
VM_IMAGE: 'ubuntu-20.04'
INSTALL_DEPS: 'sudo apt-get update && sudo apt-get -y -q --no-install-recommends install libfreetype6-dev liblua5.2-dev python-yaml python-jinja2 ninja-build'
CMAKE_OPTIONS: '-G Ninja -DCBSE_PYTHON_PATH=/usr/bin/python2 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBUILD_GAME_NATIVE_DLL=1 -DBUILD_GAME_NATIVE_EXE=0 -DBUILD_GAME_NACL=0'
BUILDER_OPTIONS: '-j$(nproc) -k 10'
Linux NaCl:
VM_IMAGE: 'ubuntu-20.04'
INSTALL_DEPS: 'sudo apt-get update && sudo apt-get -y -q --no-install-recommends install python-yaml python-jinja2 ninja-build'
CMAKE_OPTIONS: '-G Ninja -DCBSE_PYTHON_PATH=/usr/bin/python2 -DBUILD_GAME_NATIVE_DLL=0 -DBUILD_GAME_NATIVE_EXE=0 -DBUILD_GAME_NACL=1'
BUILDER_OPTIONS: '-j$(nproc) -k 10'
Mac:
VM_IMAGE: 'macOS-12'
INSTALL_DEPS: 'python3 -m pip install -r tools/cbse/requirements.txt'
CMAKE_OPTIONS: '-DCBSE_PYTHON_PATH=$(which python3) -DBUILD_GAME_NATIVE_DLL=1 -DBUILD_GAME_NATIVE_EXE=0 -DBUILD_GAME_NACL=0'
BUILDER_OPTIONS: '-j$(sysctl -n hw.logicalcpu)'
pool:
vmImage: $(VM_IMAGE)
steps:
- bash: |
set -e
echo "Variables: PR_TARGET_BRANCH=${PR_TARGET_BRANCH} PR_SOURCE_REF=${PR_SOURCE_REF} BUILD_SOURCE_BRANCH=${BUILD_SOURCE_BRANCH}"
curl -fsSL https://gitlab.com/illwieckz/git-checkout-modules/raw/master/git-checkout-modules -o ~/git-checkout-modules
chmod +x ~/git-checkout-modules
if ! [[ "$PR_SOURCE_REF" == '$('* ]]; then # It is a pull request
SOURCE_BRANCH=$(sed -e 's!^refs/heads/users/[^/]*/!!' <<< "$PR_SOURCE_REF")
SYNC_ARGS=("--sub-ref=${PR_TARGET_BRANCH}:has=/sync" "--sub-ref=${SOURCE_BRANCH}:has=/sync")
elif [[ "$BUILD_SOURCE_BRANCH" == refs/heads/* ]]; then # It is a branch build
BRANCH=$(sed -e 's!^refs/heads/!!' <<< "$BUILD_SOURCE_BRANCH")
SYNC_ARGS=("--sub-ref=${BRANCH}:has=/sync")
fi
echo "${#SYNC_ARGS[@]} branch-name-based checkout arg(s): ${SYNC_ARGS[@]}"
~/git-checkout-modules --update ${SYNC_ARGS[@]} --print
env:
# For example: "master" (on pull requests only)
PR_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
# For example: "0.52.0/sync" (pull request from within repository)
# For example: "refs/heads/users/raisa/new-feature" (pull request from other user)
# For example: "$(System.PullRequest.TargetBranch)" (when it's not a PR-triggered build)
PR_SOURCE_REF: $(System.PullRequest.SourceBranch)
# For example: "refs/heads/master" for a build of the 'master' branch
# Other formats exist for builds on pull requests or tags
BUILD_SOURCE_BRANCH: $(Build.SourceBranch)
displayName: 'Check out submodules'
- bash: |
set -e
$(INSTALL_DEPS)
cmake -DUSE_PRECOMPILED_HEADER=0 -DUSE_WERROR=1 -DBE_VERBOSE=1 -DCMAKE_BUILD_TYPE=Debug -DUSE_DEBUG_OPTIMIZE=0 -DBUILD_CLIENT=0 -DBUILD_TTY_CLIENT=0 -DBUILD_SERVER=0 $(CMAKE_OPTIONS) -H. -Bbuild
cmake --build build -- $(BUILDER_OPTIONS)
displayName: 'Build'