-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (132 loc) · 5.08 KB
/
build.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
name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
linux-build:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install cmake pkg-config
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxcb-cursor-dev
sudo apt-get install python3 pip
pip install "conan<2.0"
- name: Install GCC
run: |
echo "CC=/usr/bin/gcc-13" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-13" >> $GITHUB_ENV
sudo update-alternatives --remove-all cc
sudo update-alternatives --remove-all c++
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get install -y gcc-13 g++-13
sudo update-alternatives --install /usr/bin/cc gcc /usr/bin/gcc-13 1000 \
--slave /usr/bin/c++ g++ /usr/bin/g++-13
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_C_COMPILER=${{env.CC}} -DCMAKE_CXX_COMPILER=${{env.CXX}} \
-DENABLE_UNIT_TESTING=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j $(nproc)
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
macOS-build:
runs-on: macos-latest
env:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- run: |
python -m pip install --upgrade pip
pip install wheel
- name: Install dependencies
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew install glew sdl2 sdl2_image
- name: Install LLVM
run: |
echo "CC=/usr/local/cellar/llvm@16/16.0.6/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/local/cellar/llvm@16/16.0.6/bin/clang++" >> $GITHUB_ENV
brew install llvm@16
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.60.2
- name: Create default Conan profile
run: |
conan profile new default --detect
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_C_COMPILER=${{env.CC}} -DCMAKE_CXX_COMPILER=${{env.CXX}} \
-DENABLE_UNIT_TESTING=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j $(sysctl -n hw.ncpu)
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
windows-build:
runs-on: windows-latest
env:
BUILD_TYPE: Release
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- run: |
python -m pip install --upgrade pip
pip install wheel
- name: Install Conan
run: pip install "conan<2.0"
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_UNIT_TESTING=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
wasm-build:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Emscripten
run: |
sudo apt-get install git cmake
sudo apt-get install python3 pip
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
- name: Configure CMake
run: |
source ./emsdk/emsdk_env.sh
emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build - ${{matrix.build-type}}
run: |
source ./emsdk/emsdk_env.sh
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j $(nproc)