From 210a86ed76bde8c146a1fabf5770b3b42984b6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Sun, 11 Jul 2021 07:16:35 +0200 Subject: [PATCH 1/2] Add GitHub Action builds for changes to master and changes to Pull Requests --- .github/workflows/ci_build.yaml | 110 ++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/ci_build.yaml diff --git a/.github/workflows/ci_build.yaml b/.github/workflows/ci_build.yaml new file mode 100644 index 0000000000..6c98adcee2 --- /dev/null +++ b/.github/workflows/ci_build.yaml @@ -0,0 +1,110 @@ +name: CI Build + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - master + +jobs: + build: + name: "${{matrix.os}}, ${{matrix.qt_version}}, ${{matrix.build_type}}" + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + include: + # Windows fails because libhunspell-dev is missing. See https://github.com/OtterBrowser/otter-browser/issues/1684 + #- os: windows-latest + # build_type: qtwebengine + # qt_version: 5.15.2 + # TODO: Install QtWebKit on Windows + #- os: windows-latest + # build_type: qtwebkit + # qt_version: 5.15.2 + - os: ubuntu-18.04 + build_type: qtwebkit + qt_version: repository + apt-dependencies: git build-essential cmake qtbase5-dev libqt5core5a libqt5gui5 libqt5multimedia5 qtmultimedia5-dev libqt5network5 libqt5printsupport5 libqt5qml5 qtdeclarative5-dev libqt5svg5 libqt5svg5-dev libqt5widgets5 libhunspell-dev libqt5webkit5 libqt5webkit5-dev + - os: ubuntu-18.04 + build_type: qtwebengine + qt_version: 5.15.2 + apt-dependencies: git build-essential cmake libhunspell-dev + # TODO: Figure out how to install QtWebKit without installing its dependencies from APT + #- os: ubuntu-18.04 + # build_type: qtwebkit + # qt_version: 5.15.2 + # apt-dependencies: git build-essential cmake libhunspell-dev + - os: ubuntu-20.04 + build_type: qtwebkit + qt_version: repository + apt-dependencies: git build-essential cmake qtbase5-dev libqt5core5a libqt5gui5 libqt5multimedia5 qtmultimedia5-dev libqt5network5 libqt5printsupport5 libqt5qml5 qtdeclarative5-dev libqt5svg5 libqt5svg5-dev libqt5widgets5 libhunspell-dev libqt5webkit5 libqt5webkit5-dev + # MacOS fails because libhunspell-dev is missing. See https://github.com/OtterBrowser/otter-browser/issues/1684 + #- os: macOS-latest + # build_type: qtwebengine + # qt_version: 5.15.2 + # TODO: Install QtWebKit on MacOS + #- os: macOS-latest + # build_type: qtwebkit + # qt_version: 5.15.2 + + steps: + - name: Get Otter Browser source + uses: actions/checkout@v1 + with: + submodules: false + fetch-depth: 1 + + - name: Install Qt ${{matrix.qt_version}} with QtWebEngine + if: startsWith(matrix.os, 'windows') && startsWith(matrix.build_type, 'qtwebengine') || startsWith(matrix.os, 'macos') && startsWith(matrix.build_type, 'qtwebengine') || startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.qt_version, 'repository') && startsWith(matrix.build_type, 'qtwebengine') + uses: jurplel/install-qt-action@v2 + with: + version: ${{matrix.qt_version}} + modules: qtwebengine + + - name: Install Qt ${{matrix.qt_version}} without QtWebEngine + if: startsWith(matrix.os, 'windows') && startsWith(matrix.build_type, 'qtwebkit') || startsWith(matrix.os, 'macos') && startsWith(matrix.build_type, 'qtwebkit') || startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.qt_version, 'repository') && startsWith(matrix.build_type, 'qtwebkit') + uses: jurplel/install-qt-action@v2 + with: + version: ${{matrix.qt_version}} + + - name: Install dependencies + shell: bash + if: startsWith(matrix.os, 'ubuntu') + run: | + + echo "Updating apt repository index" + sudo apt update + + echo "Installing apt packages" + sudo apt install -y ${{ matrix.apt-dependencies }} + + # Install QtWebKit without installing Qt from the repositories. + #if [[ "${{ matrix.build_type }}" = "qtwebkit" && "${{ matrix.qt_version }}" != "repository" ]]; then + # echo "Installing QtWebKit without its dependencies" + # apt-get download libqt5webkit5 libqt5webkit5-dev + # sudo dpkg --force-all -i libqt5webkit5*.deb + #fi + + - name: Create Build Environment + shell: bash + run: cmake -E make_directory "${{runner.workspace}}/build" + + - name: Configure CMake + working-directory: ${{runner.workspace}}/build + shell: bash + run: cmake $GITHUB_WORKSPACE + + - name: Build Otter Browser + working-directory: ${{runner.workspace}}/build + shell: bash + run: cmake --build . --parallel 3 + + - name: Output system stats + if: ${{ always() }} + working-directory: ${{runner.workspace}}/build + shell: bash + run: | + echo "Disk usage:" + df -h From 1c2179964f0c1197828d317fec0dcad005eb50bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Tue, 13 Jul 2021 06:21:06 +0200 Subject: [PATCH 2/2] Install Hunspell on MacOS Try all major OS' with and without Hunspell Cache Qt Try building with Hunspell on Windows (fails) --- .github/workflows/ci_build.yaml | 104 ++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci_build.yaml b/.github/workflows/ci_build.yaml index 6c98adcee2..dc795a0e09 100644 --- a/.github/workflows/ci_build.yaml +++ b/.github/workflows/ci_build.yaml @@ -9,45 +9,42 @@ on: jobs: build: - name: "${{matrix.os}}, ${{matrix.qt_version}}, ${{matrix.build_type}}" + name: "${{matrix.os}}, ${{matrix.qt_version}}, ${{matrix.build_type}} " runs-on: ${{matrix.os}} strategy: fail-fast: false matrix: include: - # Windows fails because libhunspell-dev is missing. See https://github.com/OtterBrowser/otter-browser/issues/1684 - #- os: windows-latest - # build_type: qtwebengine - # qt_version: 5.15.2 - # TODO: Install QtWebKit on Windows - #- os: windows-latest - # build_type: qtwebkit - # qt_version: 5.15.2 + - os: windows-latest + build_type: qtwebengine with hunspell + qt_version: 5.15.2 + - os: windows-latest + build_type: qtwebengine without hunspell + qt_version: 5.15.2 + - os: ubuntu-18.04 - build_type: qtwebkit + build_type: qtwebkit with hunspell qt_version: repository apt-dependencies: git build-essential cmake qtbase5-dev libqt5core5a libqt5gui5 libqt5multimedia5 qtmultimedia5-dev libqt5network5 libqt5printsupport5 libqt5qml5 qtdeclarative5-dev libqt5svg5 libqt5svg5-dev libqt5widgets5 libhunspell-dev libqt5webkit5 libqt5webkit5-dev - os: ubuntu-18.04 - build_type: qtwebengine + build_type: qtwebkit without hunspell + qt_version: repository + apt-dependencies: git build-essential cmake qtbase5-dev libqt5core5a libqt5gui5 libqt5multimedia5 qtmultimedia5-dev libqt5network5 libqt5printsupport5 libqt5qml5 qtdeclarative5-dev libqt5svg5 libqt5svg5-dev libqt5widgets5 libqt5webkit5 libqt5webkit5-dev + - os: ubuntu-18.04 + build_type: qtwebengine with hunspell qt_version: 5.15.2 apt-dependencies: git build-essential cmake libhunspell-dev - # TODO: Figure out how to install QtWebKit without installing its dependencies from APT - #- os: ubuntu-18.04 - # build_type: qtwebkit - # qt_version: 5.15.2 - # apt-dependencies: git build-essential cmake libhunspell-dev - os: ubuntu-20.04 - build_type: qtwebkit + build_type: qtwebkit with hunspell qt_version: repository apt-dependencies: git build-essential cmake qtbase5-dev libqt5core5a libqt5gui5 libqt5multimedia5 qtmultimedia5-dev libqt5network5 libqt5printsupport5 libqt5qml5 qtdeclarative5-dev libqt5svg5 libqt5svg5-dev libqt5widgets5 libhunspell-dev libqt5webkit5 libqt5webkit5-dev - # MacOS fails because libhunspell-dev is missing. See https://github.com/OtterBrowser/otter-browser/issues/1684 - #- os: macOS-latest - # build_type: qtwebengine - # qt_version: 5.15.2 - # TODO: Install QtWebKit on MacOS - #- os: macOS-latest - # build_type: qtwebkit - # qt_version: 5.15.2 + + - os: macOS-latest + build_type: qtwebengine with hunspell + qt_version: 5.15.2 + - os: macOS-latest + build_type: qtwebengine without hunspell + qt_version: 5.15.2 steps: - name: Get Otter Browser source @@ -56,36 +53,67 @@ jobs: submodules: false fetch-depth: 1 + - name: Cache Qt + if: !startsWith(matrix.qt_version, 'repository') + id: cache-qt + uses: actions/cache@v2 + with: + path: ${{runner.workspace}}/Qt + key: ${{runner.os}}-QtCache + - name: Install Qt ${{matrix.qt_version}} with QtWebEngine if: startsWith(matrix.os, 'windows') && startsWith(matrix.build_type, 'qtwebengine') || startsWith(matrix.os, 'macos') && startsWith(matrix.build_type, 'qtwebengine') || startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.qt_version, 'repository') && startsWith(matrix.build_type, 'qtwebengine') uses: jurplel/install-qt-action@v2 with: version: ${{matrix.qt_version}} modules: qtwebengine + cached: ${{steps.cache-qt.outputs.cache-hit}} - name: Install Qt ${{matrix.qt_version}} without QtWebEngine if: startsWith(matrix.os, 'windows') && startsWith(matrix.build_type, 'qtwebkit') || startsWith(matrix.os, 'macos') && startsWith(matrix.build_type, 'qtwebkit') || startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.qt_version, 'repository') && startsWith(matrix.build_type, 'qtwebkit') uses: jurplel/install-qt-action@v2 with: version: ${{matrix.qt_version}} + cached: ${{steps.cache-qt.outputs.cache-hit}} + + - name: Install hunspell dependencies on Windows + if: startsWith(matrix.os, 'windows') && endsWith(matrix.build_type, 'with hunspell') + uses: msys2/setup-msys2@v2 + with: + install: >- + base-devel + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-libtool + + - name: Install hunspell on Windows + if: startsWith(matrix.os, 'windows') && endsWith(matrix.build_type, 'with hunspell') + shell: msys2 {0} + run: | + curl -Ls https://github.com/hunspell/hunspell/files/2573619/hunspell-1.7.0.tar.gz -o hunspell.tar.gz + tar -xf hunspell.tar.gz + cd hunspell-1.7.0 + autoreconf -vfi + ./configure + make -j2 + echo "CMAKE_BUILD_EXTRA=-DHunspell_INCLUDE_DIR=$RUNNER_WORKSPACE\hunspell-1.7.0\src\ -DHunspell_LIBRARIES=hunspell-1.7" >> $GITHUB_ENV - name: Install dependencies shell: bash - if: startsWith(matrix.os, 'ubuntu') run: | - echo "Updating apt repository index" - sudo apt update - - echo "Installing apt packages" - sudo apt install -y ${{ matrix.apt-dependencies }} + # Install APT dependencies on Ubuntu + if [[ "${{ matrix.os }}" = "ubuntu"* ]]; then + echo "Updating apt repository index" + sudo apt update + echo "Installing apt packages" + sudo apt install -y ${{ matrix.apt-dependencies }} + fi - # Install QtWebKit without installing Qt from the repositories. - #if [[ "${{ matrix.build_type }}" = "qtwebkit" && "${{ matrix.qt_version }}" != "repository" ]]; then - # echo "Installing QtWebKit without its dependencies" - # apt-get download libqt5webkit5 libqt5webkit5-dev - # sudo dpkg --force-all -i libqt5webkit5*.deb - #fi + # Install Hunspell on MacOS + if [[ "${{ matrix.os }}" = "macOS"* && "${{ matrix.build_type }}" != *"without"* ]]; then + echo "Installing Hunspell" + brew install hunspell + fi - name: Create Build Environment shell: bash @@ -94,7 +122,7 @@ jobs: - name: Configure CMake working-directory: ${{runner.workspace}}/build shell: bash - run: cmake $GITHUB_WORKSPACE + run: cmake $GITHUB_WORKSPACE $CMAKE_BUILD_EXTRA - name: Build Otter Browser working-directory: ${{runner.workspace}}/build