version: 2.1 orbs: codecov: codecov/codecov@1.1.1 executors: ubuntu-18_04: docker: - image: ubuntu:bionic-20220427 xcode-11_5: # Molten-vk isn't in (non-updated) Homebrew on the 9.4 or 10.0/1/2 image, # have to use 10.3 instead; since 2021-06-08 it refuses to work on 10.14 so # have to use 11.2 at least; since 2022-01-20 the oldest 11 image is 11.4. # Since 2922-05-23, 11.4.1 images wait endlessly for "VM assignment", using # 11.5 instead. macos: xcode: 11.5 xcode-11_6: macos: xcode: 11.6.0 emscripten1: docker: # 1.39.0 is the oldest on Docker. Anything before 1.39.2 is useless as emar # randomly asserts: https://github.com/emscripten-core/emscripten/pull/9742 # Then, anything before 1.39.6 is useless as well because emar has a # filesystem race and randomly complains that a file doesn't exist: # https://github.com/mosra/magnum/issues/413, # https://github.com/emscripten-core/emscripten/pull/10161 - image: emscripten/emsdk:1.39.6-upstream emscripten2: docker: # Used by the webgl2 job. 2.0.17 is the first version that exposes # glGetBufferSubData() so GLES3 tests can read buffer data without having # to check the Emscripten version. 2.0.17 dies midway compiling however, so # using some newer version. 2.0.18 to 2.0.24 then fails due to an # unresolved malloc dependency of glGetString() (!!!), in 2.0.25 it # mysteriously disappears. See https://github.com/mosra/magnum/issues/507. - image: emscripten/emsdk:2.0.25 android-29: machine: image: android:202102-01 arm64: machine: image: ubuntu-2004:202101-01 resource_class: arm.medium commands: install-base-linux: parameters: extra: type: string default: "" steps: - run: name: Update apt and install base packages # Git is needed always for cloning Corrade command: | apt update if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then export LCOV_PACKAGES="lcov curl"; fi # libidn11 needed by CMake apt install -y git ninja-build libidn11 $LCOV_PACKAGES << parameters.extra >> install-base-linux-arm64: parameters: extra: type: string default: "" steps: - run: name: Update apt and install base packages # Compared to Docker images this needs sudo command: | sudo apt update if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then export LCOV_PACKAGES="lcov curl"; fi sudo apt install -y ninja-build gcc cmake $LCOV_PACKAGES << parameters.extra >> cap-ninja-jobs: parameters: count: type: integer # It reports 36 cores and ninja goes with 38 currently, RAM fluctuates # from 3 to 70 GB. default: 24 steps: - run: name: Query CPU cores, default Ninja parallelism and available RAM, cap jobs command: | nproc ninja --help 2>&1 | grep "N jobs in parallel" || true free echo "export NINJA_JOBS=-j<< parameters.count >>" >> $BASH_ENV install-base-macos: parameters: extra: type: string default: "" steps: - run: name: Install base packages # As usual, homebrew takes five minutes to update and then explodes in # a spectacular way. How is this acceptable?! command: | if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then export LCOV_PACKAGES="lcov"; fi HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake ninja $LCOV_PACKAGES << parameters.extra >> install-base-android: steps: - run: name: Create Android 29 x86 AVD command: | SYSTEM_IMAGES="system-images;android-29;default;x86" sdkmanager "$SYSTEM_IMAGES" echo "no" | avdmanager --verbose create avd -n test -k "$SYSTEM_IMAGES" - run: name: Launch Android emulator command: | emulator -avd test -delay-adb -verbose -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim background: true - run: name: Update apt and install base packages # Compared to Docker images this needs sudo command: | sudo apt update sudo apt install -y ninja-build install-gcc-4_8: steps: - run: name: Install GCC 4.8 # For some reason, CMake needs a working C compiler, so provice CC as # well for the case when default gcc isn't installed. command: | apt install -y g++-4.8 echo 'export CC=gcc-4.8' >> $BASH_ENV echo 'export CXX=g++-4.8' >> $BASH_ENV # While we want to make sure the project builds on GCC 4.8 as certain # embedded toolchains still use it, for Clang we just pick the version # available in the oldest supported distro. install-clang: steps: - run: # For some reason, CMake needs a working C compiler, so provice CC as # well for the case when default gcc isn't installed. # # The llvm-symbolizer link needs to be set in order to have usable # symbols in the output. This affects suppressions as well, meaning # they won't work if the symbols are not resolvable. It's not enough to # just `export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-6.0` # because it then complains that # # External symbolizer path is set to '/usr/bin/llvm-symbolizer-6.0' # which isn't a known symbolizer. Please set the path to the # llvm-symbolizer binary or other known tool. # # Probably because because it detects tool type based on the filename? # Ugh. name: Install Clang command: | apt install -y clang echo 'export CC=clang' >> $BASH_ENV echo 'export CXX=clang++' >> $BASH_ENV ls -l /usr/bin/llvm-symbolizer-6.0 ln -s /usr/bin/llvm-symbolizer{-6.0,} install-cmake: parameters: version: type: string sudo: type: string default: "" steps: - run: name: Install CMake << parameters.version >> command: | version_short=<< parameters.version >> version_short="${version_short%.*}" << parameters.sudo >> apt install -y wget mkdir -p $HOME/cmake && cd $HOME/cmake wget -nc --no-check-certificate https://cmake.org/files/v$version_short/cmake-<< parameters.version >>-Linux-x86_64.tar.gz tar --strip-components=1 -xzf cmake-<< parameters.version >>-Linux-x86_64.tar.gz echo 'export PATH=$HOME/cmake/bin:$PATH' >> $BASH_ENV source $BASH_ENV cmake --version | grep << parameters.version >> ctest --version | grep << parameters.version >> install-swiftshader-gles: parameters: build: type: string steps: - run: name: Install SwiftShader GLES # Zip from https://github.com/mosra/magnum-ci/tree/swiftshader and # self-hosted because GH Actions would make it too simple for people if # you could just download the artifacts directly, right? RIGHT? command: | mkdir -p $HOME/swiftshader && cd $HOME/swiftshader wget https://ci.magnum.graphics/swiftshader-gles-r5464.a6940c8e6e-<< parameters.build >>.zip unzip swiftshader-gles-r5464.a6940c8e6e-<< parameters.build >>.zip install-swiftshader-vulkan: parameters: build: type: string steps: - run: name: Install SwiftShader Vulkan # Zip from https://github.com/mosra/magnum-ci/tree/swiftshader and # self-hosted because GH Actions would make it too simple for people if # you could just download the artifacts directly, right? RIGHT? command: | mkdir -p $HOME/swiftshader && cd $HOME/swiftshader wget https://ci.magnum.graphics/swiftshader-vulkan-r5464.a6940c8e6e-<< parameters.build >>.zip unzip swiftshader-vulkan-r5464.a6940c8e6e-<< parameters.build >>.zip install-vulkan-loader: parameters: build: type: string steps: - run: name: Install Vulkan Loader # Zip from https://github.com/mosra/magnum-ci/tree/vulkan-loader and # self-hosted because GH Actions would make it too simple for people if # you could just download the artifacts directly, right? RIGHT? command: | mkdir -p $HOME/vulkan-loader && cd $HOME/vulkan-loader wget https://ci.magnum.graphics/vulkan-loader-1.2.153-<< parameters.build >>.zip unzip vulkan-loader-1.2.153-<< parameters.build >>.zip setup-null-openal-driver: steps: - run: name: Set up a null OpenAL driver command: printf "[General]\ndrivers=null" > ~/.alsoftrc build: parameters: script: type: string steps: - checkout - run: name: Build & test command: | if [ "$BUILD_STATIC" != "ON" ]; then export BUILD_STATIC=OFF; fi if [ "$BUILD_DEPRECATED" != "OFF" ]; then export BUILD_DEPRECATED=ON; fi if [ "$BUILD_APPLICATIONS" != "OFF" ]; then export BUILD_APPLICATIONS=ON; fi ./package/ci/<< parameters.script >> lcov: steps: - run: name: Collect code coverage # Keep in sync with PKBUILD-coverage and appveyor-lcov.sh, please command: | lcov $LCOV_EXTRA_OPTS --directory . --capture --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --extract coverage.info "*/src/Magnum*/*" --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/MagnumExternal/*" --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/Test/*" --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --remove coverage.info "*/build/src/*" --output-file coverage.info > /dev/null - codecov/upload: file: coverage.info jobs: linux-gl: executor: ubuntu-18_04 environment: CMAKE_CXX_FLAGS: --coverage LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 CONFIGURATION: Debug PLATFORM_GL_API: GLX steps: - install-base-linux: extra: libgl1-mesa-dev libsdl2-dev libglfw3-dev libopenal-dev libvulkan-dev # It crashes with the default setting. Only on GCC, usually when the huge # TradeAbstractImporterTest / TradeMaterialDataTest get involved. # TODO: revisit when we get rid of more STL - cap-ninja-jobs - install-gcc-4_8 - install-cmake: version: "3.4.3" - setup-null-openal-driver - build: script: unix-desktop.sh - lcov linux-arm64: executor: arm64 environment: CMAKE_CXX_FLAGS: --coverage CONFIGURATION: Debug PLATFORM_GL_API: GLX steps: # Not installing the old GCC 4.8 and CMake 3.4 to speed up. These are # tested more than enough on other jobs. - install-base-linux-arm64: extra: libgl1-mesa-dev libsdl2-dev libglfw3-dev libopenal-dev libvulkan-dev - setup-null-openal-driver - build: script: unix-desktop.sh - lcov linux-vulkan: executor: ubuntu-18_04 environment: CMAKE_CXX_FLAGS: --coverage LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 CONFIGURATION: Debug steps: - install-base-linux: extra: cmake libsdl2-dev libglfw3-dev libvulkan-dev wget unzip # It crashes with the default setting. Only on GCC, usually when the huge # TradeAbstractImporterTest / TradeMaterialDataTest / TradeSceneDataTest # get involved. # TODO: revisit when we get rid of more STL - cap-ninja-jobs - install-gcc-4_8 - install-swiftshader-vulkan: build: ubuntu-18.04 - build: script: unix-desktop-vulkan.sh - lcov linux-gles2: executor: ubuntu-18_04 environment: CMAKE_CXX_FLAGS: --coverage LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 CONFIGURATION: Debug PLATFORM_GL_API: EGL # STUPID yml interprets unquoted ON as a boolean TARGET_GLES2: "ON" steps: - install-base-linux: extra: libsdl2-dev libglfw3-dev wget unzip # It crashes with the default setting. Only on GCC, usually when the huge # TradeAbstractImporterTest / TradeMaterialDataTest / TradeSceneDataTest # get involved. # TODO: revisit when we get rid of more STL - cap-ninja-jobs - install-gcc-4_8 - install-cmake: version: "3.4.3" - install-swiftshader-gles: build: ubuntu-16.04 - build: script: unix-desktop-gles.sh - lcov linux-gles3: executor: ubuntu-18_04 environment: CMAKE_CXX_FLAGS: --coverage LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 CONFIGURATION: Debug PLATFORM_GL_API: EGL # STUPID yml interprets unquoted OFF as a boolean TARGET_GLES2: "OFF" steps: - install-base-linux: extra: libsdl2-dev libglfw3-dev wget unzip # It crashes with the default setting. Only on GCC, usually when the huge # TradeAbstractImporterTest / TradeMaterialDataTest / TradeSceneDataTest # get involved. # TODO: revisit when we get rid of more STL - cap-ninja-jobs - install-gcc-4_8 - install-cmake: version: "3.4.3" - install-swiftshader-gles: build: ubuntu-16.04 - build: script: unix-desktop-gles.sh - lcov linux-static: executor: ubuntu-18_04 environment: # STUPID yml interprets unquoted ON as a boolean # https://stackoverflow.com/questions/53648244/specifying-the-string-value-yes-in-a-yaml-property BUILD_STATIC: "ON" CMAKE_CXX_FLAGS: --coverage LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 CONFIGURATION: Debug PLATFORM_GL_API: GLX steps: - install-base-linux: extra: libgl1-mesa-dev libsdl2-dev libglfw3-dev libopenal-dev libvulkan-dev # 24 is not enough, unlike the other GCC-based builds # TODO: revisit when we get rid of more STL - cap-ninja-jobs: count: 20 - install-gcc-4_8 - install-cmake: version: "3.4.3" - setup-null-openal-driver - build: script: unix-desktop.sh - lcov linux-nondeprecated: executor: ubuntu-18_04 environment: # STUPID yml interprets unquoted OFF as a boolean BUILD_DEPRECATED: "OFF" CMAKE_CXX_FLAGS: -DCORRADE_NO_ASSERT CONFIGURATION: Release PLATFORM_GL_API: GLX steps: - install-base-linux: extra: libgl1-mesa-dev libsdl2-dev libglfw3-dev libopenal-dev libvulkan-dev # It crashes with the default setting. Only on GCC, usually when the huge # TradeAbstractImporterTest / TradeMaterialDataTest / TradeSceneDataTest # get involved. # TODO: revisit when we get rid of more STL - cap-ninja-jobs - install-gcc-4_8 - install-cmake: version: "3.4.3" - setup-null-openal-driver - build: script: unix-desktop.sh linux-sanitizers: executor: ubuntu-18_04 environment: # STUPID yml interprets unquoted OFF as a boolean. Applications don't # have any automated tests, so building them for sanitizers doesn't make # sense. BUILD_APPLICATIONS: "OFF" CMAKE_CXX_FLAGS: -fsanitize=address CONFIGURATION: Debug PLATFORM_GL_API: GLX steps: - install-base-linux: extra: libgl1-mesa-dev libopenal-dev libvulkan-dev - install-clang - install-cmake: version: "3.4.3" - setup-null-openal-driver - build: script: unix-desktop.sh linux-threadsanitizer: executor: ubuntu-18_04 environment: # STUPID yml interprets unquoted OFF as a boolean. Applications don't # have any automated tests, so building them for sanitizers doesn't make # sense. BUILD_APPLICATIONS: "OFF" CMAKE_CXX_FLAGS: -fsanitize=thread CONFIGURATION: Debug PLATFORM_GL_API: GLX steps: - install-base-linux: extra: libgl1-mesa-dev libopenal-dev libvulkan-dev - install-clang - install-cmake: version: "3.4.3" - setup-null-openal-driver - build: script: unix-desktop.sh macos-gl: executor: xcode-11_5 environment: CMAKE_CXX_FLAGS: --coverage CONFIGURATION: Debug PLATFORM_GL_API: CGL steps: - install-base-macos: extra: sdl2 glfw molten-vk - build: script: unix-desktop.sh - lcov macos-gles3: executor: xcode-11_5 environment: CMAKE_CXX_FLAGS: --coverage CONFIGURATION: Debug PLATFORM_GL_API: EGL # STUPID yml interprets unquoted OFF as a boolean TARGET_GLES2: "OFF" steps: - install-base-macos: extra: sdl2 glfw wget - install-swiftshader-gles: build: macos-10.15 - build: script: unix-desktop-gles.sh - lcov macos-vulkan: # SwiftShader is built on 10.15 and can't be used on older versions due to # dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin executor: xcode-11_6 environment: CMAKE_CXX_FLAGS: --coverage CONFIGURATION: Debug steps: - install-base-macos: extra: sdl2 glfw wget - install-swiftshader-vulkan: build: macos-10.15 - install-vulkan-loader: build: macos-10.15 - build: script: unix-desktop-vulkan.sh - lcov macos-static: executor: xcode-11_5 environment: # STUPID yml interprets unquoted ON as a boolean BUILD_STATIC: "ON" CMAKE_CXX_FLAGS: --coverage CONFIGURATION: Debug PLATFORM_GL_API: CGL steps: - install-base-macos: extra: sdl2 glfw molten-vk - build: script: unix-desktop.sh - lcov emscripten-webgl1: executor: emscripten1 environment: # STUPID yml interprets unquoted ON as a boolean TARGET_GLES2: "ON" steps: - install-base-linux - cap-ninja-jobs - build: script: emscripten.sh emscripten-webgl2: executor: emscripten2 environment: # STUPID yml interprets unquoted OFF as a boolean TARGET_GLES2: "OFF" steps: - install-base-linux - cap-ninja-jobs - build: script: emscripten.sh android-x86-gles2: executor: android-29 environment: # STUPID yml interprets unquoted ON as a boolean TARGET_GLES2: "ON" steps: - install-base-android # We need ctest --timeout for flaky adb push, which is since 3.17. The # image had 3.16.3 by default, so it's just a small jump. - install-cmake: version: "3.17.5" sudo: sudo - build: script: android-x86-gles.sh android-x86-gles3: executor: android-29 environment: # STUPID yml interprets unquoted ON as a boolean TARGET_GLES2: "OFF" steps: - install-base-android # We need ctest --timeout for flaky adb push, which is since 3.17. The # image had 3.16.3 by default, so it's just a small jump. - install-cmake: version: "3.17.5" sudo: sudo - build: script: android-x86-gles.sh android-x86-vulkan: executor: android-29 steps: - install-base-android # We need ctest --timeout for flaky adb push, which is since 3.17. The # image had 3.16.3 by default, so it's just a small jump. - install-cmake: version: "3.17.5" sudo: sudo - build: script: android-x86-vulkan.sh ios-gles3: executor: xcode-11_5 environment: # STUPID yml interprets unquoted ON as a boolean TARGET_GLES2: "OFF" steps: - install-base-macos: extra: xcbeautify - build: script: ios-simulator-gles.sh workflows: version: 2 build: jobs: - linux-gl - linux-arm64 - linux-vulkan - linux-gles2 - linux-gles3 - linux-static - linux-nondeprecated - linux-sanitizers - linux-threadsanitizer - macos-gl - macos-vulkan - macos-gles3 - macos-static - emscripten-webgl1 - emscripten-webgl2 - android-x86-gles2 - android-x86-gles3 - android-x86-vulkan - ios-gles3