-
Notifications
You must be signed in to change notification settings - Fork 160
141 lines (118 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
name: build
on: [push]
jobs:
linux-build:
strategy:
fail-fast: false
matrix:
build-type: [Release]
compiler: [GCC, Clang]
cmake-var: [ENABLE_CONAN=OFF] # ENABLE_CONAN=ON, ENABLE_CONAN=OFF
runs-on: ubuntu-latest
env:
BUILD_TYPE: ${{matrix.build-type}}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies (ENABLE_CONAN=ON)
if: matrix.cmake-var == 'ENABLE_CONAN=ON'
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 dependencies (ENABLE_CONAN=OFF)
if: matrix.cmake-var == 'ENABLE_CONAN=OFF'
run: |
sudo apt-get install cmake
sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev
- name: Install GCC
if: matrix.compiler == 'GCC'
run: |
echo "CC=/usr/bin/gcc-12" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-12" >> $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-12 g++-12
sudo update-alternatives --install /usr/bin/cc gcc /usr/bin/gcc-12 1000 \
--slave /usr/bin/c++ g++ /usr/bin/g++-12
- name: Install Clang
if: matrix.compiler == 'Clang'
run: |
echo "CC=/usr/bin/clang-16" >> $GITHUB_ENV
echo "CXX=/usr/bin/clang++-16" >> $GITHUB_ENV
sudo update-alternatives --remove-all cc
sudo update-alternatives --remove-all c++
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository -y "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-16 main"
sudo apt-get install -y clang-16 lld-16
sudo update-alternatives --install /usr/bin/cc clang /usr/bin/clang-16 1000 \
--slave /usr/bin/ld lld /usr/bin/lld-16
sudo update-alternatives --install /usr/bin/c++ clang++ /usr/bin/clang++-16 1000
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D${{matrix.cmake-var}} -DCMAKE_C_COMPILER=${{env.CC}} -DCMAKE_CXX_COMPILER=${{env.CXX}}
- 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}}
# windows-build:
# strategy:
# fail-fast: false
# matrix:
# build-type: [Release]
# runs-on: windows-latest
# env:
# BUILD_TYPE: ${{matrix.build-type}}
# 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_CONAN=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
run: |
source ./emsdk/emsdk_env.sh
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j $(nproc)
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}