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

WIP: CMake build #344

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
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
155 changes: 155 additions & 0 deletions .github/workflows/Build-Linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: CI build Linux

on:
push:
release:
types:
- created

jobs:

build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-16.04
qt_version: Qt5
qt_base_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-5.15.1/qtBase_5.15.1_xenial.zip
ARTIFACT_NAME: YUView-cmake.AppImage
- os: ubuntu-18.04
qt_version: Qt5
qt_base_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-5.15.1/qtBase_5.15.1_bionic.zip
- os: ubuntu-16.04
qt_version: Qt6
qt_base_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.0.2/qtBase_6.0.2_xenial.zip
- os: ubuntu-18.04
qt_version: Qt6
qt_base_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.0.2/qtBase_6.0.2_bionic.zip
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow

##########################################################################################
############################### Required packages from distributors ######################
##########################################################################################

- name: Install and remove Linux packages
shell: bash
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libpcre2-16-0 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libatspi2.0-dev
# remove installed qt versions if any. they can interfere with the packaging tools
sudo apt-get autoremove '.*qt.*'

- name: Install Newer GCC Ubuntu 16.04
if: matrix.os == 'ubuntu-16.04'
shell: bash
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --config gcc

##########################################################################################
############################### Packages build by us: Qt, libde265 ######################
##########################################################################################

- name: Install Qt base
shell: bash
run: |
cd $HOME
mkdir -p YUViewQt/
cd YUViewQt
curl -L ${{matrix.qt_base_link}} -o Qt.zip
unzip -qa Qt.zip

- name: Install libde265
shell: bash
run: |
curl -L https://github.com/ChristianFeldmann/libde265/releases/download/v1.1/libde265.so -o libde265-internals.so
curl -L https://raw.githubusercontent.com/ChristianFeldmann/libde265/master/COPYING -o libde265License.txt

##########################################################################################
############################### Build YUView #############################################
##########################################################################################

- name: Build Linux/Mac
shell: bash
run: |
cd $GITHUB_WORKSPACE
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="$HOME/YUViewQt/Qt" -DCMAKE_INSTALL_PREFIX=/usr ..
cmake --build . --parallel $(nproc)

##########################################################################################
############################### Unit tests ###############################################
##########################################################################################

- name: Run unit tests
shell: bash
run: |
cd $GITHUB_WORKSPACE/build
ctest --output-on-failure
# ctest --output-on-failure --debug --extra-verbose

##########################################################################################
############################### Packaging YUView, Installers #############################
##########################################################################################

- name: Build Appimage (Linux)
# only run on oldest supported ubuntu:
# Please run on a system with a glibc version no newer than what comes with the oldest
# currently still-supported mainstream distribution.
# This is so that the resulting bundle will work on most still-supported Linux distributions.
if: matrix.os == 'ubuntu-16.04' && matrix.qt_version == 'Qt5'
shell: bash
run: |
cd $HOME
curl -L https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage -o linuxdeployqt-6-x86_64.AppImage
chmod a+x linuxdeployqt-6-x86_64.AppImage
cd $GITHUB_WORKSPACE/build
make install DESTDIR=appdir
$HOME/linuxdeployqt-6-x86_64.AppImage appdir/usr/share/applications/de.rwth_aachen.ient.YUView.desktop -appimage -qmake=$HOME/YUViewQt/Qt/bin/qmake -bundle-non-qt-libs -verbose=2
echo "ls -l appdir"; ls -l appdir
mv YUView-*.AppImage ${{matrix.ARTIFACT_NAME}}
mkdir $GITHUB_WORKSPACE/artifacts
cp ${{matrix.ARTIFACT_NAME}} $GITHUB_WORKSPACE/artifacts/
cd $GITHUB_WORKSPACE
echo "ls -l build"; ls -l build
ls -l
cd $GITHUB_WORKSPACE/artifacts
ls -l

##########################################################################################
############################### Upload artifacts #########################################
##########################################################################################

- name: Upload Artifact
if: matrix.os == 'ubuntu-16.04' && matrix.qt_version == 'Qt5'
uses: actions/upload-artifact@v2
with:
name: ${{matrix.ARTIFACT_NAME}}
path: artifacts

##########################################################################################
############################### Upload release ###########################################
##########################################################################################

- name: Upload Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: artifacts/${{matrix.ARTIFACT_NAME}}
asset_name: ${{matrix.ARTIFACT_NAME}}
asset_content_type: application/zip
if: github.event_name == 'release' && matrix.os == 'ubuntu-16.04' && matrix.qt_version == 'Qt5'

# How to upload files to the release:
# https://github.com/Blacksmoke16/oq/pull/47/files#diff-082c28d748ad2e3eecc5508d740d9417R9-R29
# Mime type list
# https://www.iana.org/assignments/media-types/media-types.xhtml
134 changes: 134 additions & 0 deletions .github/workflows/Build-Mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: CI build Mac

on:
push:
release:
types:
- created

jobs:

build-mac:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-10.15
qt_version: Qt5
qt_base_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-5.15.1/qtBase_5.15.1_mac.zip
qt_tools_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtDeployTools-5.15.1/qtTools_5.15.1_mac.zip
qt_tools_path: Qttools/bin/macdeployqt
ARTIFACT_NAME: YUView-Mac-cmake.zip
- os: macos-10.15
qt_version: Qt6
qt_base_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.0.2/qtBase_6.0.2_mac.zip
qt_tools_link: https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtDeployTools-6.0.2/qtTools_6.0.2_mac.zip
qt_tools_path: build/bin/macdeployqt
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow

##########################################################################################
############################### Packages build by us: Qt, libde265 ######################
##########################################################################################

- name: Install Qt base
run: |
cd $HOME
mkdir -p YUViewQt
cd YUViewQt
curl -L ${{matrix.qt_base_link}} -o Qt.zip
unzip -qa Qt.zip
shell: bash

- name: Install Qt deploy tools
shell: bash
run: |
cd $HOME
cd YUViewQt
curl -L ${{matrix.qt_tools_link}} -o deployQt.zip
7z x deployQt.zip
cp ${{matrix.qt_tools_path}} Qt/bin/macdeployqt
strip Qt/bin/macdeployqt

- name: Install libde265
run: |
cd $HOME
curl -L https://github.com/ChristianFeldmann/libde265/releases/download/v1.1/libde265.dylib -o libde265-internals.dylib
curl -L https://raw.githubusercontent.com/ChristianFeldmann/libde265/master/COPYING -o libde265License.txt
shell: bash

##########################################################################################
############################### Build YUView #############################################
##########################################################################################

- name: Build
run: |
cd $GITHUB_WORKSPACE
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="$HOME/YUViewQt/Qt" -DCMAKE_INSTALL_PREFIX=/usr ..
cmake --build . --parallel $(nproc)
shell: bash

##########################################################################################
############################### Unit tests ###############################################
##########################################################################################

- name: Run unit tests
run: |
cd $GITHUB_WORKSPACE/build
ctest --output-on-failure
# ctest --output-on-failure --debug --extra-verbose
shell: bash

##########################################################################################
############################### Packaging YUView, Installers #############################
##########################################################################################

- name: Build App (Mac)
if: matrix.qt_version == 'Qt5' && matrix.os == 'macos-10.15'
run: |
cd $GITHUB_WORKSPACE
$HOME/YUViewQt/Qt/bin/macdeployqt build/YUView.app -always-overwrite -verbose=2
cp $HOME/libde265-internals.dylib build/YUView.app/Contents/MacOS/.
echo "ls -l build/YUView.app/Contents/MacOS/"; ls -l build/YUView.app/Contents/MacOS/
cd build
# Zip
zip -r ${{matrix.ARTIFACT_NAME}} YUView.app/
mkdir $GITHUB_WORKSPACE/artifacts
echo "ls -l"; ls -l
cp ${{matrix.ARTIFACT_NAME}} $GITHUB_WORKSPACE/artifacts/
echo "ls -l $GITHUB_WORKSPACE/artifacts"; ls -l $GITHUB_WORKSPACE/artifacts


##########################################################################################
############################### Upload artifacts #########################################
##########################################################################################

- name: Upload Artifact
if: matrix.qt_version == 'Qt5'
uses: actions/upload-artifact@v2
with:
name: ${{matrix.ARTIFACT_NAME}}
path: artifacts

##########################################################################################
############################### Upload release ###########################################
##########################################################################################

- name: Upload Release
if: matrix.qt_version == 'Qt5' && github.event_name == 'release' && matrix.os == 'macos-10.15'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: artifacts/${{matrix.ARTIFACT_NAME}}
asset_name: ${{matrix.ARTIFACT_NAME}}
asset_content_type: application/zip

# How to upload files to the release:
# https://github.com/Blacksmoke16/oq/pull/47/files#diff-082c28d748ad2e3eecc5508d740d9417R9-R29
# Mime type list
# https://www.iana.org/assignments/media-types/media-types.xhtml
Loading