version: 2.1 orbs: codecov: codecov/codecov@1.1.1 executors: ubuntu-18_04: docker: - image: ubuntu:bionic-20220427 # Anything below 11.7 is deprecated as of June 6th 2022 xcode-11_7: macos: xcode: 11.7.0 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 etc command: | apt update if [[ "$CMAKE_CXX_FLAGS" == *"--coverage"* ]]; then export LCOV_PACKAGES="lcov curl"; fi apt install -y git ninja-build $LCOV_PACKAGES << parameters.extra >> 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-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 install-cmake-3_4: steps: - run: name: Install CMake 3.4 command: | apt install -y wget libidn11 mkdir -p $HOME/cmake && cd $HOME/cmake wget -nc --no-check-certificate https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz tar --strip-components=1 -xzf cmake-3.4.3-Linux-x86_64.tar.gz echo 'export PATH=$HOME/cmake/bin:$PATH' >> $BASH_ENV source $BASH_ENV && cmake --version | grep 3.4 install-python-3_6: # Can't use the python3.6 docker image because there I can't install GCC # 4.8. Loosely based on https://gist.github.com/monkut/c4c07059444fd06f3f8661e13ccac619 # The deadsnakes PPA no longer supports 16.04, so this repo builds against # 18.04. steps: - run: name: Install Python 3.6 and numpy # The software-properties-common need to be installed in order to have # apt-add-repository. Sigh, adding a repository should be a core # feature ffs! # # Also, "Press ENTER to continue." Are we still in the DOS days?! # # Setting up 3.6 as the default is OF COURSE one command more than # would be acceptable, but am I surprised on this distro?! command: | apt install -y software-properties-common echo -e "\n" | add-apt-repository ppa:deadsnakes/ppa apt update apt install -y python3.6 python3.6-dev python3-pip update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 10 python3 --version | grep 3.6 python3 -m pip install pip --upgrade python3 -m pip install wheel pip3 install numpy install-pybind11: steps: - run: name: Install Pybind11 command: | cd $HOME export PYBIND_VERSION=2.3.0 wget --no-clobber https://github.com/pybind/pybind11/archive/v$PYBIND_VERSION.tar.gz tar -xzf v$PYBIND_VERSION.tar.gz cd pybind11-$PYBIND_VERSION mkdir -p build && cd build cmake .. \ -DCMAKE_INSTALL_PREFIX=$HOME/pybind11 \ -DPYBIND11_PYTHON_VERSION=3.6 \ -DPYBIND11_TEST=OFF \ -G Ninja ninja install 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 build: parameters: script: type: string steps: - run: name: Install coverage and codecov command: pip3 install coverage codecov - 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 ./package/ci/<< parameters.script >> lcov: steps: - run: name: Collect code coverage # Keep in sync with PKBUILD-coverage, please command: | lcov $LCOV_EXTRA_OPTS --directory . --capture --output-file coverage.info > /dev/null lcov $LCOV_EXTRA_OPTS --extract coverage.info "*/src/python/*" "*/src/Corrade/*" "*/src/Magnum/*" --output-file coverage.info > /dev/null cd src/python && coverage combine - 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 PLATFORM_GL_API: GLX # It crashes (OOM, probably) with the default setting NINJA_JOBS: -j2 steps: - install-base-linux: extra: libgl1-mesa-dev libsdl2-dev libglfw3-dev - install-gcc-4_8 - install-cmake-3_4 - install-python-3_6 - install-pybind11 - build: script: unix-desktop.sh - lcov linux-gles2: executor: ubuntu-18_04 environment: CMAKE_CXX_FLAGS: --coverage LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 PLATFORM_GL_API: EGL # STUPID yml interprets unquoted ON as a boolean TARGET_GLES2: "ON" # It crashes (OOM, probably) with the default setting NINJA_JOBS: -j2 steps: - install-base-linux: extra: libsdl2-dev libglfw3-dev wget unzip - install-gcc-4_8 - install-cmake-3_4 - install-python-3_6 - install-pybind11 - 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 PLATFORM_GL_API: EGL # STUPID yml interprets unquoted OFF as a boolean TARGET_GLES2: "OFF" # It crashes (OOM, probably) with the default setting NINJA_JOBS: -j2 steps: - install-base-linux: extra: libsdl2-dev libglfw3-dev wget unzip - install-gcc-4_8 - install-cmake-3_4 - install-python-3_6 - install-pybind11 - 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 PLATFORM_GL_API: GLX # It crashes (OOM, probably) with the default setting NINJA_JOBS: -j2 steps: - install-base-linux: extra: libsdl2-dev libglfw3-dev - install-gcc-4_8 - install-cmake-3_4 - install-python-3_6 - install-pybind11 - build: script: unix-desktop.sh - lcov macos-gl: executor: xcode-11_7 environment: CMAKE_CXX_FLAGS: --coverage PLATFORM_GL_API: CGL steps: - install-base-macos: extra: sdl2 glfw numpy pybind11 - build: script: unix-desktop.sh - lcov macos-gles3: executor: xcode-11_7 environment: CMAKE_CXX_FLAGS: --coverage PLATFORM_GL_API: EGL # STUPID yml interprets unquoted OFF as a boolean TARGET_GLES2: "OFF" steps: - install-base-macos: extra: sdl2 glfw wget numpy pybind11 - install-swiftshader-gles: build: macos-10.15 - build: script: unix-desktop-gles.sh - lcov macos-static: executor: xcode-11_7 environment: # STUPID yml interprets unquoted ON as a boolean BUILD_STATIC: "ON" CMAKE_CXX_FLAGS: --coverage PLATFORM_GL_API: CGL steps: - install-base-macos: extra: sdl2 glfw numpy pybind11 - build: script: unix-desktop.sh - lcov workflows: version: 2 build: jobs: - linux-gl - linux-gles2 - linux-gles3 - linux-static - macos-gl - macos-gles3 - macos-static