7 changed files with 307 additions and 34 deletions
@ -0,0 +1,281 @@ |
|||||||
|
version: 2.1 |
||||||
|
|
||||||
|
orbs: |
||||||
|
codecov: codecov/codecov@1.1.1 |
||||||
|
|
||||||
|
notify: |
||||||
|
webhooks: |
||||||
|
# Unfortunately Gitter messages are too verbose (one five-line message per |
||||||
|
# each job in the build matrix) and thus not wanted |
||||||
|
#- url: https://webhooks.gitter.im/e/cfbadbd34d28708a57c6 |
||||||
|
|
||||||
|
executors: |
||||||
|
ubuntu-16_04: |
||||||
|
docker: |
||||||
|
- image: ubuntu:xenial-20201014 |
||||||
|
xcode-10_3: |
||||||
|
macos: |
||||||
|
xcode: 10.3.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 |
||||||
|
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 |
||||||
|
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 and travis.yml, 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-16_04 |
||||||
|
environment: |
||||||
|
CMAKE_CXX_FLAGS: --coverage |
||||||
|
LCOV_EXTRA_OPTS: --gcov-tool /usr/bin/gcov-4.8 |
||||||
|
PLATFORM_GL_API: GLX |
||||||
|
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-16_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" |
||||||
|
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-16_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" |
||||||
|
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-16_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 |
||||||
|
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: |
||||||
|
# 10.2 and below has pybind11 2.2, which is just too old (we removed |
||||||
|
# support for that in aae98e0f02e927f993713afc154da1f3673ebb3e, July 2019) |
||||||
|
executor: xcode-10_3 |
||||||
|
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-static: |
||||||
|
# 10.2 and below has pybind11 2.2, which is just too old (we removed |
||||||
|
# support for that in aae98e0f02e927f993713afc154da1f3673ebb3e, July 2019) |
||||||
|
executor: xcode-10_3 |
||||||
|
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-static |
||||||
@ -1,9 +1,12 @@ |
|||||||
fixes: |
fixes: |
||||||
# The src/python/magnum/__init__.py is copied to cmake's build dir together |
# The src/python/magnum/__init__.py is copied to cmake's build dir together |
||||||
# with # setup.py next to the C++ binaries and the test is done from here. |
# with setup.py next to the C++ binaries and the test is done from here. |
||||||
# Python's coverage.py reports an absolute path to it, which means a simple |
# Python's coverage.py reports an absolute path to it, which means a simple |
||||||
# "build/src/python/::src/python/" won't suffice. This is hardcoded to Travis |
# "build/src/python/::src/python/" won't suffice. This is hardcoded to Travis, |
||||||
# Linux / macOS and AppVeyor build paths so let's hope these won't change. |
# CircleCI Linux / macOS and AppVeyor build paths so let's hope these won't |
||||||
|
# change. |
||||||
- "/home/travis/build/mosra/magnum-bindings/build/src/python/::src/python/" |
- "/home/travis/build/mosra/magnum-bindings/build/src/python/::src/python/" |
||||||
- "/Users/travis/build/mosra/magnum-bindings/build/src/python/::src/python/" |
- "/Users/travis/build/mosra/magnum-bindings/build/src/python/::src/python/" |
||||||
|
- "/root/project/build/src/python/::src/python/" |
||||||
|
- "/Users/distiller/project/build/src/python/::src/python/" |
||||||
- "C:/projects/magnum-bindings/build/src/python/::src/python/" |
- "C:/projects/magnum-bindings/build/src/python/::src/python/" |
||||||
|
|||||||
@ -1,13 +0,0 @@ |
|||||||
set -e |
|
||||||
|
|
||||||
wget --no-clobber https://github.com/pybind/pybind11/archive/v2.3.0.tar.gz && tar -xzf v2.3.0.tar.gz |
|
||||||
|
|
||||||
cd pybind11-2.3.0 |
|
||||||
|
|
||||||
mkdir -p build && cd build |
|
||||||
cmake .. \ |
|
||||||
-DCMAKE_INSTALL_PREFIX=$HOME/pybind11 \ |
|
||||||
-DPYBIND11_PYTHON_VERSION=3.6 \ |
|
||||||
-DPYBIND11_TEST=OFF \ |
|
||||||
-G Ninja |
|
||||||
ninja install |
|
||||||
Loading…
Reference in new issue