Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Add support for GitHub Actions

Tact Yoshidac4f6911808f4
diff --git a/.github/workflows/CMakeLists.txt b/.github/workflows/CMakeLists.txt
new file mode 100644
index 000000000..60179e41e
--- /dev/null
+++ b/.github/workflows/CMakeLists.txt
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 2.8.12)
+
+project(mypaint LANGUAGES C)
+
+find_package(json-c CONFIG REQUIRED)
+
+include_directories(${JSON-C_INCLUDE_DIR})
+
+set(sources
+ brushmodes.c
+ fifo.c
+ helpers.c
+ mypaint-brush-settings.c
+ mypaint-brush.c
+ mypaint-fixed-tiled-surface.c
+ mypaint-mapping.c
+ mypaint-matrix.c
+ mypaint-rectangle.c
+ mypaint-surface.c
+ mypaint-symmetry.c
+ mypaint-tiled-surface.c
+ mypaint.c
+ operationqueue.c
+ rng-double.c
+ tilemap.c
+ utils.c
+)
+set(headers
+ mypaint-config.h
+ mypaint-glib-compat.h
+ mypaint-mapping.h
+ mypaint-matrix.h
+ mypaint-symmetry.h
+ config.h
+ mypaint.h
+)
+
+add_library(libmypaint STATIC ${sources} ${headers})
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..c11391816
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,227 @@
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+ Ubuntu:
+ runs-on: ubuntu-18.04
+ strategy:
+ matrix:
+ compiler: [gcc, clang]
+ include:
+ - compiler: gcc
+ cc: gcc
+ cxx: g++
+ - compiler: clang
+ cc: clang
+ cxx: clang++
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install libraries
+ run: |
+ sudo apt update
+ sudo apt install build-essential cmake pkg-config ninja-build ccache libboost-all-dev qt5-default qtbase5-dev libqt5svg5-dev qtscript5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtmultimedia5-dev libsuperlu-dev liblz4-dev libusb-1.0-0-dev liblzo2-dev libpng-dev libjpeg-dev libglew-dev freeglut3-dev libfreetype6-dev libjson-c-dev qtwayland5 libmypaint-dev
+
+ - uses: actions/cache@v1
+ with:
+ path: /home/runner/.ccache
+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
+ restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
+
+ - name: Build libtiff
+ run: |
+ cd thirdparty/tiff-4.0.3
+ CFLAGS='-fPIC' CXXFLAGS='-fPIC' ./configure --disable-jbig
+ make -j $(nproc)
+
+ - name: Build
+ run: |
+ cd toonz
+ mkdir build
+ cd build
+ cmake ../sources -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }}
+ ninja
+
+ macOS:
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install libraries
+ run: |
+ brew update
+ brew install pkg-config ninja glew lz4 libjpeg libpng lzo qt boost libusb libmypaint ccache
+ # temp workaround to brew installed glew cmake info overriding glew lib detection
+ # which causes compiling issues later
+ if [ -L /usr/local/lib/cmake/glew ]
+ then
+ echo "Symbolic link '/usr/local/lib/cmake/glew' detected. Removing to avoid glew lib detection issue!"
+ ls -l /usr/local/lib/cmake/glew
+ rm /usr/local/lib/cmake/glew
+ fi
+
+ - uses: actions/cache@v1
+ with:
+ path: /Users/runner/.ccache
+ key: ${{ runner.os }}-${{ github.sha }}
+ restore-keys: ${{ runner.os }}-
+
+ - name: Build libtiff
+ run: |
+ cd thirdparty/tiff-4.0.3
+ CFLAGS='-fPIC' CXXFLAGS='-fPIC' ./configure --disable-lzma
+ make -j $(nproc)
+
+ - name: Build
+ run: |
+ cd toonz
+ mkdir build
+ cd build
+ cmake ../sources -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQT_PATH='/usr/local/opt/qt/lib'
+ ninja -w dupbuild=warn
+
+ Windows:
+ runs-on: windows-2019
+ env:
+ vcpkg_ref: d989ad416b923a9f895c4bddc446d1ef370a3af8
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Checkout mypaint/libmypaint
+ uses: actions/checkout@v2
+ with:
+ repository: 'mypaint/libmypaint'
+ ref: '70f7686db792fa4953dc60f28a322bf2cd388ed7'
+ path: 'libmypaint'
+
+ - name: Checkout xiaoyeli/superlu
+ uses: actions/checkout@v2
+ with:
+ repository: 'xiaoyeli/superlu'
+ ref: 'a3d5233770f0caad4bc4578b46d3b26af99e9c19'
+ path: 'superlu'
+
+ - name: Install vcpkg
+ run: |
+ rm -r -fo C:/vcpkg
+ cd C:/
+ git clone https://github.com/Microsoft/vcpkg
+ cd vcpkg
+ git checkout "$env:vcpkg_ref"
+ ./bootstrap-vcpkg.bat
+
+ - uses: actions/cache@v1
+ with:
+ path: C:/vcpkg/installed
+ key: ${{ runner.os }}-vcpkg-${{ env.vcpkg_ref }}-${{ github.sha }}
+ restore-keys: ${{ runner.os }}-vcpkg-${{ env.vcpkg_ref }}-
+
+ - name: Install libraries
+ run: |
+ vcpkg install --clean-after-build --triplet x64-windows icu
+ vcpkg install --clean-after-build --triplet x64-windows-static json-c libjpeg-turbo libpng lz4 lzo openblas zlib
+ vcpkg install --clean-after-build --triplet x64-windows freeglut glew
+ vcpkg install --clean-after-build --triplet x64-windows qt5-base qt5-multimedia qt5-script qt5-svg qt5-tools
+
+ - name: Build libtiff
+ run: |
+ cd thirdparty/tiff-4.0.3
+ cp libtiff/tif_config.vc.h libtiff/tif_config.h
+ cp libtiff/tiffconf.vc.h libtiff/tiffconf.h
+ cd prj/LibTIFF
+ $env:Path += ';C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin'
+ msbuild LibTIFF.vcxproj /p:PlatformToolset=v142 /p:Platform=x64 /p:Configuration=Release -maxcpucount:3
+
+ - name: Build mypaint/libmypaint
+ run: |
+ cd libmypaint
+ cp ../.github/workflows/CMakeLists.txt .
+ echo '#define MYPAINT_CONFIG_USE_GLIB 0' > config.h
+ python generate.py mypaint-brush-settings-gen.h brushsettings-gen.h
+ mkdir build
+ cd build
+ cmake ../ -G 'Visual Studio 16 2019' -Ax64 -Djson-c_DIR='C:/vcpkg/installed/x64-windows-static/share/json-c/' -DJSON-C_INCLUDE_DIR='C:/vcpkg/installed/x64-windows-static/include/json-c/'
+ cmake --build . --config Release
+ cp C:/vcpkg/installed/x64-windows-static/lib/json-c.lib .
+ $env:Path += ';C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64'
+ lib /OUT:libmypaint.lib Release/libmypaint.lib json-c.lib
+ cp libmypaint.lib Release/libmypaint.lib
+
+ - name: Build xiaoyeli/superlu
+ run: |
+ cd superlu
+ mkdir build
+ cd build
+ cmake ../ -G 'Visual Studio 16 2019' -Ax64 -DXSDK_ENABLE_Fortran=OFF -Denable_tests=OFF
+ cmake --build . --config Release
+
+ - name: Workaround
+ run: |
+ cd thirdparty
+ cp C:/vcpkg/installed/x64-windows-static/lib/jpeg.lib LibJPEG/jpeg-9/lib/LibJPEG-9_2015_64.lib
+ cp C:/vcpkg/installed/x64-windows-static/lib/libpng16.lib libpng-1.6.21/lib/libpng16_2015_64.lib
+ cp C:/vcpkg/installed/x64-windows-static/lib/lz4.lib Lz4/Lz4_131/lz4_64.lib
+ cp C:/vcpkg/installed/x64-windows-static/lib/lzo2.lib lzo/2.03/LZO_lib/lzo2_64.lib
+ cp C:/vcpkg/installed/x64-windows-static/lib/openblas.lib openblas/libopenblas_64.lib
+ cp C:/vcpkg/installed/x64-windows-static/lib/zlib.lib zlib-1.2.8/lib/zlib-1.2.8_2015_64.lib
+ cp C:/vcpkg/installed/x64-windows/lib/freeglut.lib glut/3.7.6/lib/glut64.lib
+ cp C:/vcpkg/installed/x64-windows/lib/glew32.lib glew/glew-1.9.0/lib/glew64.lib
+ cp D:/a/opentoonz/opentoonz/libmypaint/build/Release/libmypaint.lib libmypaint/dist/64/libmypaint.lib
+ cp D:/a/opentoonz/opentoonz/superlu/build/SRC/Release/superlu.lib superlu/SuperLU_2015_64.lib
+ cp D:/a/opentoonz/opentoonz/thirdparty/tiff-4.0.3/prj/LibTIFF/x64/Release/LibTIFF.lib tiff-4.0.3/lib/LibTIFF-4.0.3_2015_64.lib
+
+ - name: Copy headers
+ run: |
+ cd thirdparty
+ cp LibJPEG/jpeg-9/jconfig.vc LibJPEG/jpeg-9/jconfig.h
+ cp libpng-1.6.21/scripts/pnglibconf.h.prebuilt libpng-1.6.21/pnglibconf.h
+
+ - name: Build
+ run: |
+ cd toonz
+ mkdir build
+ cd build
+ cmake ../sources -G 'Visual Studio 16 2019' -Ax64 -DQT_PATH='C:/vcpkg/installed/x64-windows/bin' -DQt5_DIR='C:/vcpkg/installed/x64-windows/share/cmake/Qt5' -DBOOST_ROOT="$env:BOOST_ROOT_1_69_0"
+ cmake --build . --config Release
+
+ - name: Create Artifact
+ run: |
+ mkdir artifact
+ cd artifact
+ cp -Recurse ../stuff 'OpenToonz stuff'
+ mkdir OpenToonz
+ cd OpenToonz
+ cp ../../toonz/build/Release/* .
+ cp C:/vcpkg/installed/x64-windows/bin/freeglut.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/glew32.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Core.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Gui.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Multimedia.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Network.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5OpenGL.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5PrintSupport.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Script.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Svg.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/Qt5Widgets.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/bz2.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/freetype.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/harfbuzz.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/icudt61.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/icuin61.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/icuuc61.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/libpng16.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/pcre2-16.dll .
+ cp C:/vcpkg/installed/x64-windows/bin/zlib1.dll .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/audio .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/bearer .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/iconengines .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/imageformats .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/mediaservice .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/platforms .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/playlistformats .
+ cp -Recurse C:/vcpkg/installed/x64-windows/plugins/printsupport .
+
+ - uses: actions/upload-artifact@v1
+ with:
+ name: Opentoonz-${{ github.sha }}
+ path: artifact