Merge pull request #18 from abacchi00/fix/compile-error-fmt-string #5
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
name: build | |
on: [push] | |
jobs: | |
linux-build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build-type: [Release] | |
compiler: [GCC, Clang] | |
cmake-var: [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}} |