Skip to content

[Examples/FullDemo] The mesh's script source can be edited from the demo #1481

[Examples/FullDemo] The mesh's script source can be edited from the demo

[Examples/FullDemo] The mesh's script source can be edited from the demo #1481

Workflow file for this run

name: RaZ
on: [push, pull_request]
jobs:
#########
# Linux #
#########
linux:
name: Linux (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: gcc, cpp: g++ }
- { c: clang, cpp: clang++ }
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: gcc, cpp: g++ }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing the needed packages:
# - Ninja to build the project
# - GLEW & X11 as graphical dependencies
# - Lcov to output code coverage
# - Doxygen & Dot to generate the documentation
# - OpenAL-soft to handle the audio part
# - Xvfb to launch a headless server (allows GL context initialisation without a screen)
# - Gdb to run the unit tests with the debugger
# - Mesa-utils to get glxinfo
# Running glxinfo through xvfb to recover graphics capabilities
- name: Packages installation
run: |
sudo apt update && sudo apt install -y --no-install-recommends \
ninja-build \
libglew-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev \
lcov \
doxygen python3-pydot \
libopenal-dev \
xvfb \
gdb \
mesa-utils &&
xvfb-run -a glxinfo -B
# Installing the FBX SDK (in /usr)
# The installation asks for software user agreement (send 'yes'), then afterward if the README file should be opened (send 'n')
#- name: FBX SDK setup
# run: |
# wget http://download.autodesk.com/us/fbx/2019/2019.0/fbx20190_fbxsdk_linux.tar.gz -O ./fbx_sdk.tar.gz &&
# tar xvf ./fbx_sdk.tar.gz &&
# chmod +x ./fbx20190_fbxsdk_linux &&
# printf 'yes\nn' | sudo ./fbx20190_fbxsdk_linux /usr
- name: Build setup
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=ON -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON ${{ matrix.compiler.c == 'gcc' && '-DRAZ_ENABLE_COVERAGE=ON' || '' }} \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
${{ github.workspace }} &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
# Running the tests using gdb to catch potential segfaults
- name: Test
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
ALSOFT_DRIVERS=null xvfb-run -a --server-args='-screen 0 1280x720x16' \
gdb --batch --return-child-result -x '${{ github.workspace }}/tests/assets/debug/gdb_commands.txt' ./tests/RaZ_Tests
# Preparing code coverage; only done with GCC in Debug with audio enabled
- name: Coverage setup
if: matrix.compiler.c == 'gcc' && matrix.build_type == 'Debug' && matrix.use_audio
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
lcov -d ./CMakeFiles/RaZ.dir/src/ -c -o coverage.info &&
lcov -r coverage.info '/usr/*' -o coverage.info &&
lcov -l coverage.info
# Processing code coverage; only done with GCC in Debug with audio enabled
- name: Coverage processing
if: matrix.compiler.c == 'gcc' && matrix.build_type == 'Debug' && matrix.use_audio
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: github-actions-${{ github.run_id }}
path-to-lcov: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}/coverage.info
# Installing RaZ in the build directory; default is /usr/local
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: sudo cmake --install . --prefix ./ --config ${{ matrix.build_type }}
- name: Upload build
if: matrix.use_audio
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/include
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/lib
###########
# Windows #
###########
windows:
name: Windows (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler:
- { c: cl, cpp: cl }
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: cl, cpp: cl }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing OpenAL-soft to handle the audio part
- name: Build setup
run: |
curl --silent --insecure https://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip -O &&
7z x openal-soft-1.21.0-bin.zip &&
mv openal-soft-1.21.0-bin C:/OpenAL;
cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -G"Visual Studio 17 2022" -A x64 \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=OFF -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: cmake --install . --prefix C:/RaZ --config ${{ matrix.build_type }}
- name: Upload build
if: matrix.use_audio
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
C:/RaZ
#########
# macOS #
#########
macos:
name: macOS (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: clang, cpp: clang++ }
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: clang, cpp: clang++ }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing the needed packages:
# - Ninja to build the project
# - OpenAL-soft to handle the audio part
- name: Packages installation
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install \
ninja \
openal-soft
- name: Build setup
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=OFF -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
shell: bash
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
# Installing RaZ in the build directory; default is /usr/local
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: sudo cmake --install . --prefix ./ --config ${{ matrix.build_type }}
- name: Upload build
if: matrix.use_audio
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/include
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/lib
##############
# Emscripten #
##############
emscripten:
name: Emscripten (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: emcc, cpp: em++, version: 3.1.0 } # The 'latest' version may fail to build
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: emcc, cpp: em++, version: 3.1.0 }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing the needed packages:
# - Ninja to build the project
# - GL & X11 as needed graphical dependencies
# - OpenAL-soft to handle the audio part
- name: Packages installation
run: |
sudo apt update && sudo apt install -y --no-install-recommends \
ninja-build \
libglew-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev \
libopenal-dev
#- name: FBX SDK setup
# run: |
# wget http://download.autodesk.com/us/fbx/2019/2019.0/fbx20190_fbxsdk_linux.tar.gz -O ./fbx_sdk.tar.gz &&
# tar xvf ./fbx_sdk.tar.gz &&
# chmod +x ./fbx20190_fbxsdk_linux &&
# printf 'yes\nn' | ./fbx20190_fbxsdk_linux /usr
# Caching Emscripten's installation; this avoids installing it on every build
- name: Emscripten caching
uses: actions/cache@v3
id: emsdk
with:
path: ~/emsdk
key: emsdk-${{ matrix.compiler.version }}
restore-keys: |
emsdk-${{ matrix.compiler.version }}
# Downloading & installing Emscripten; only done when failed to find its cached installation
- name: Emscripten setup
if: steps.emsdk.outputs.cache-hit != 'true'
shell: bash
run: |
git clone --depth 1 https://github.com/emscripten-core/emsdk.git ~/emsdk &&
~/emsdk/emsdk install ${{ matrix.compiler.version }} && ~/emsdk/emsdk activate ${{ matrix.compiler.version }}
# Downloading & installing Emscripten, to build RaZ in WebAssembly
- name: Build setup
shell: bash
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
source ~/emsdk/emsdk_env.sh &&
emcmake cmake -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=OFF -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON ${{ matrix.build_type == 'Debug' && '-DRAZ_EMSCRIPTEN_DEBUG_FAST_LINK=ON' || '' }} \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .