Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial GitHub workflow implementation #700

Merged
merged 1 commit into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Tests

on:
push:
branches:
- RB-2.5
paths-ignore:
- Documentation
pull_request:
branches:
- RB-2.5
paths-ignore:
- Documentation

jobs:
test:
name: Test ${{ matrix.os }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.special-invocation }}bash -l {0}
env:
CI: 'True'
PYTHON_VERSION: ${{ matrix.python-version }}
# PYSIDE2_VERSION: ${{ matrix.pyside2-version }}
# PYSIDE2_QT_VERSION: ${{ matrix.pyside2-qt-version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04] # macos-latest, windows-latest
python-version: ['2.7'] # '3.6', '3.9'
include:
- os: ubuntu-18.04
special-invocation: 'xvfb-run --auto-servernum '
python-version: '2.7'
# python-version: '3.6'
# pyside2-version: 5.12.0 # 5.12.1-5.12.6 fails on collection/segfaults on patch test
# - os: windows-latest
# python-version: '3.9'
# pyside2-version: 5.15 # No 5.12 wheel on Windows and Python 3.9
# - os: macos-latest
# python-version: '2.7'
# python-version: '3.6'
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Install Linux system packages
if: contains(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt update
sudo apt install libpulse-dev libegl1-mesa libopengl0 gcc-8 g++-8 libqt4-dev libqt4-opengl-dev libglew-dev libexpat1-dev \
gdb libcairo2-dev python-dev python-pyside libpyside-dev libshiboken-dev libtinyxml-dev liblcms2-dev libyaml-cpp-dev \
libopenjp2-7-dev libtiff-dev libjpeg-dev libpng-dev libwebp-dev libraw-dev libfreetype6-dev libssl-dev libboost-all-dev \
python-qtpy
- name: Install Macos system packages
if: contains(matrix.os, 'macos')
shell: bash
run: |
brew install xctool python@2 boost giflib jpeg libpng libtiff libxml2 openssl pcre readline sqlite expat cairo \
gnu-sed glew openssl ilmbase openexr freetype fontconfig ffmpeg openjpeg libraw libheif openvdb
- name: Build
if: always() && !contains(github.ref, 'coverity_scan')
run: |
./.github/workflows/gen_config.sh
./tools/travis/build.sh
- name: Upload coverage data to coveralls.io
if: contains(matrix.os, 'ubuntu') && contains(github.ref, 'coverity_scan')
shell: bash
env:
COVERALLS_FLAG_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ln -s Tests/google-mock Tests/google-test .
pushd Tests
gcov -lp *.gcno > /dev/null
popd ..
python -m pip install --upgrade cpp-coveralls
python -b -X dev -m cpp-coveralls -n --exclude /usr/include --exclude 'Tests/google-test' --exclude 'Tests/google-mock' \
--exclude 'google-test' --exclude 'google-mock' --exclude 'libs/OpenFX' --exclude-pattern '.*/moc_.*\.cpp' \
--exclude-pattern='.*/Tests/.*\.cpp' --exclude-pattern='.*/Tests/.*\.h'
48 changes: 48 additions & 0 deletions .github/workflows/gen_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Natron <http://www.natron.fr/>,
# Copyright (C) 2018-2021 The Natron developers
# Copyright (C) 2013-2018 INRIA and Alexandre Gauthier-Foichat
#
# Natron is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Natron is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>
# ***** END LICENSE BLOCK *****

# config.pri
if [[ ${RUNNER_OS} == "Linux" ]]; then
# Ubuntu 12.04 precise doesn't have a pkg-config file for expat (expat.pc)
echo 'boost: LIBS += -lboost_serialization' > config.pri
echo 'expat: LIBS += -lexpat' >> config.pri
echo 'expat: PKGCONFIG -= expat' >> config.pri
# pyside and shiboken for python3 cannot be configured with pkg-config on Ubuntu 12.04LTS Precise
# pyside and shiboken for python2 still need the extra QtCore and QtGui include directories
echo 'PYSIDE_PKG_CONFIG_PATH = $$system($$PYTHON_CONFIG --prefix)/lib/pkgconfig' >> config.pri
echo 'pyside: PKGCONFIG -= pyside' >> config.pri
echo 'pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)' >> config.pri
echo 'pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtCore' >> config.pri
echo 'pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtGui' >> config.pri
echo 'pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir QtGui)' >> config.pri
#echo 'pyside: LIBS += -lpyside.cpython-32mu' >> config.pri
echo 'pyside: LIBS += -lpyside-python2.7' >> config.pri
# pyside doesn't have PySide::getWrapperForQObject on Ubuntu 12.04LTS Precise
echo 'pyside: DEFINES += PYSIDE_OLD' >> config.pri
#echo 'shiboken: PKGCONFIG -= shiboken' >> config.pri
#echo 'shiboken: INCLUDEPATH += $$system(pkg-config --variable=includedir shiboken)' >> config.pri
#echo 'shiboken: LIBS += -lshiboken.cpython-32mu' >> config.pri
elif [[ ${RUNNER_OS} == "Linux" ]]; then
echo 'boost: INCLUDEPATH += /usr/local/include' > config.pri
echo 'boost: LIBS += -L/usr/local/lib -lboost_serialization-mt -lboost_thread-mt -lboost_system-mt' >> config.pri
echo 'expat: PKGCONFIG -= expat' >> config.pri
echo 'expat: INCLUDEPATH += /usr/local/opt/expat/include' >> config.pri
echo 'expat: LIBS += -L/usr/local/opt/expat/lib -lexpat' >> config.pri
fi