diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 45c75f44..88562d67 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -7,24 +7,52 @@ jobs: runs-on: ubuntu-16.04 strategy: matrix: - compiler: [ clang ] + compiler: [ gcc, clang ] include: + - compiler: gcc + cc: gcc + cxx: g++ - compiler: clang cc: clang cxx: clang++ steps: - uses: actions/checkout@v2 - name: Install Dependencies - run: bash ./ci-scripts/linux/tahoma-install.sh + run: | + ci-scripts/linux/tahoma-install.sh + sudo apt-get install ccache + - uses: actions/cache@v2 + with: + path: | + /home/runner/.ccache + /home/runner/work/tahoma2d/taoma2d/thirdparty/openh264 + /home/runner/work/tahoma2d/taoma2d/thirdparty/ffmpeg + /home/runner/work/tahoma2d/taoma2d/thirdparty/ffmpeg_shared + /home/runner/work/tahoma2d/taoma2d/thirdparty/opencv + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ matrix.compiler }}- + ${{ runner.os }}- - name: Build ffmpeg - run: bash ./ci-scripts/linux/tahoma-buildffmpeg.sh + run: | + export CC="ccache ${{ matrix.cc }}" + export CXX="ccache ${{ matrix.cxx }}" + ci-scripts/linux/tahoma-buildffmpeg.sh - name: Build OpenCV - run: bash ./ci-scripts/linux/tahoma-buildopencv.sh + run: | + export CC="ccache ${{ matrix.cc }}" + export CXX="ccache ${{ matrix.cxx }}" + ci-scripts/linux/tahoma-buildopencv.sh - name: Build Tahoma2D - run: bash ./ci-scripts/linux/tahoma-build.sh + run: | + export CC="ccache ${{ matrix.cc }}" + export CXX="ccache ${{ matrix.cxx }}" + ci-scripts/linux/tahoma-build.sh - name: Create Package - run: bash ./ci-scripts/linux/tahoma-buildpkg.sh + run: | + ci-scripts/linux/tahoma-buildpkg.sh + mv toonz/build/Tahoma2D-linux.tar.gz toonz/build/Tahoma2D-linux-${{ matrix.compiler }}.tar.gz - uses: actions/upload-artifact@v1 with: - name: Tahoma2D-linux.tar.gz - path: toonz/build/Tahoma2D-linux.tar.gz + name: Tahoma2D-linux-${{ matrix.compiler }}.tar.gz + path: toonz/build/Tahoma2D-linux-${{ matrix.compiler }}.tar.gz diff --git a/.github/workflows/macOS_build.yml b/.github/workflows/macOS_build.yml index a2760910..12fd4218 100644 --- a/.github/workflows/macOS_build.yml +++ b/.github/workflows/macOS_build.yml @@ -8,13 +8,32 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Dependencies - run: bash ./ci-scripts/osx/tahoma-install.sh + run: | + ci-scripts/osx/tahoma-install.sh + brew install ccache + mkdir /Users/runner/.ccache + - uses: actions/cache@v2 + with: + path: | + /Users/runner/.ccache + /Users/runner/work/tahoma2d/taoma2d/thirdparty/aom + /Users/runner/work/tahoma2d/taoma2d/thirdparty/ffmpeg + /Users/runner/work/tahoma2d/taoma2d/thirdparty/ffmpeg_shared + /Users/runner/work/tahoma2d/taoma2d/thirdparty/opencv + key: ${{ runner.os }}-${{ github.sha }} + restore-keys: ${{ runner.os }}- - name: Build ffmpeg - run: bash ./ci-scripts/osx/tahoma-buildffmpeg.sh + run: | + export PATH="/usr/local/opt/ccache/libexec:$PATH" + ci-scripts/osx/tahoma-buildffmpeg.sh - name: Build OpenCV - run: bash ./ci-scripts/osx/tahoma-buildopencv.sh + run: | + export PATH="/usr/local/opt/ccache/libexec:$PATH" + ci-scripts/osx/tahoma-buildopencv.sh - name: Build Tahoma2D - run: bash ./ci-scripts/osx/tahoma-build.sh + run: | + export PATH="/usr/local/opt/ccache/libexec:$PATH" + ci-scripts/osx/tahoma-build.sh - name: Create Package run: bash ./ci-scripts/osx/tahoma-buildpkg.sh - uses: actions/upload-artifact@v1 diff --git a/ci-scripts/linux/tahoma-buildffmpeg.sh b/ci-scripts/linux/tahoma-buildffmpeg.sh index b5bf8733..ba293bfe 100755 --- a/ci-scripts/linux/tahoma-buildffmpeg.sh +++ b/ci-scripts/linux/tahoma-buildffmpeg.sh @@ -16,14 +16,17 @@ cd .. echo ">>> Cloning ffmpeg" git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg +cp -R ffmpeg ffmpeg_shared -cd ffmpeg +cd ffmpeg_shared echo "*" >| .gitignore echo ">>> Configuring to build ffmpeg (shared)" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local \ + --cc="$CC" \ + --cxx="$CXX" \ --toolchain=hardened \ --pkg-config-flags="--static" \ --extra-cflags="-I/usr/local/include" \ @@ -64,10 +67,14 @@ sudo make install sudo ldconfig echo ">>> Configuring to build ffmpeg (static)" +cd ../ffmpeg +echo "*" >| .gitignore export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local \ + --cc="$CC" \ + --cxx="$CXX" \ --pkg-config-flags="--static" \ --extra-cflags="-I/usr/local/include -static" \ --extra-ldflags="-L/usr/local/lib -static" \ diff --git a/ci-scripts/osx/tahoma-buildffmpeg.sh b/ci-scripts/osx/tahoma-buildffmpeg.sh index e9dd7478..0b1eeaa9 100755 --- a/ci-scripts/osx/tahoma-buildffmpeg.sh +++ b/ci-scripts/osx/tahoma-buildffmpeg.sh @@ -26,8 +26,9 @@ cd ../.. echo ">>> Cloning ffmpeg" git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg +cp -R ffmpeg ffmpeg_shared -cd ffmpeg +cd ffmpeg_shared echo "*" >| .gitignore echo ">>> Configuring to build ffmpeg (shared)" @@ -73,7 +74,8 @@ echo ">>> Installing ffmpeg (shared)" sudo make install echo ">>> Configuring to build ffmpeg (static)" -make clean +cd ../ffmpeg +echo "*" >| .gitignore export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig export SDKROOT=`xcrun --show-sdk-path`