Skip to content

Rework checking for portable mode #348

Rework checking for portable mode

Rework checking for portable mode #348

Workflow file for this run

name: CI
on:
- push
- pull_request
- workflow_dispatch
jobs:
build-linux-legacy:
name: Linux (legacy)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: docker build -f .github/workflows/Dockerfile.legacy .
################################################################################
build-linux-qt6:
name: Linux (Qt6)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: docker build -f .github/workflows/Dockerfile.arch-qt6 .
################################################################################
build-sanitizer:
name: Sanitizer (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: docker build -f .github/workflows/Dockerfile.sanitizer .
################################################################################
coverage-linux:
name: Coverage (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt update && sudo apt install --assume-yes --no-install-recommends qtbase5-dev qtdeclarative5-dev qtscript5-dev qttools5-dev qttools5-dev-tools zlib1g-dev libhunspell-dev libpoppler-qt5-dev libpoppler-private-dev liblua5.3-dev xvfb fonts-urw-base35 poppler-data lcov
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug" -DWITH_COVERAGE=On .
- name: Build
run: cmake --build build
- name: Test
working-directory: build
run: |
echo "::group::Initialization"
lcov --zerocounters --directory .
lcov --capture --initial --directory . --output-file "coverage.base"
echo "::endgroup::"
echo "::group::Run tests"
xvfb-run ctest -V
echo "::endgroup::"
echo "::group::Collect data"
lcov --capture --directory . --output-file "coverage.info"
lcov --add-tracefile "coverage.base" --add-tracefile "coverage.info" --output-file "coverage.info"
lcov --remove "coverage.info" '/usr/*' --output-file "coverage.info"
echo "::endgroup::"
echo "::group::Info"
lcov --list coverage.info #debug info
echo "::endgroup::"
echo "::group::Upload to Codecov"
bash <(curl -s https://codecov.io/bash) || echo "::warning::Codecov did not collect coverage reports"
echo "::endgroup::"
################################################################################
build-win-msys:
name: Windows (MSYS)
runs-on: windows-latest
if: false
defaults:
run:
shell: msys2 {0}
steps:
- name: Configure Git
run: git config --global core.autocrlf input
shell: bash
- name: Setup MSYS
uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-cmake git make mingw-w64-x86_64-gcc mingw-w64-x86_64-hunspell mingw-w64-x86_64-lua mingw-w64-x86_64-poppler mingw-w64-x86_64-qt5
- name: Checkout
uses: actions/checkout@v3
- name: Configure
run: cmake -G 'MSYS Makefiles' -B build -DTW_BUILD_ID='github' -DTEXWORKS_ADDITIONAL_LIBS='shlwapi'
- name: Build
run: cmake --build build -j
- name: Test
run: ctest -V
working-directory: build
env:
QT_FORCE_STDERR_LOGGING: 1
################################################################################
build-win-msvc:
name: Windows (MSVC)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.*
modules: qt5compat
# Strawberry perl comes with all sorts of libraries (without headers) that
# can wreak havoc when building some of the dependencies
- name: Remove Strawberry Perl
run: rm -r -fo C:/Strawberry
- name: Install dependencies
run: |
cmake -B "${{ runner.workspace }}/tw-deps-build" -S "${{ github.workspace }}/.github/actions/msvc-dependencies" -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/tw-deps"
cmake --build "${{ runner.workspace }}/tw-deps-build" --config Release
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' -DCMAKE_PREFIX_PATH="${{ runner.workspace }}/tw-deps" -Dgp_tool='none' -DQT_DEFAULT_MAJOR_VERSION=6
- name: Build
run: cmake --build build --config Release
- name: Prepare for testing
run: |
cmake -E copy_directory build/share build/Release/share
cd "${{ runner.workspace }}/tw-deps/bin"
cmake -E copy freetype.dll lcms2.dll libhunspell.dll libpng16.dll lua.dll openjp2.dll poppler.dll poppler-qt6.dll tiff.dll zlib1.dll "${{ github.workspace }}/build/Release/"
- name: Test
run: ctest -V -C Release
working-directory: build
env:
QT_FORCE_STDERR_LOGGING: 1
################################################################################
macosx-homebrew:
name: Mac OS X (Homebrew)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
# /usr/local/bin/2to3 and some other programs, as well as versioned
# variants (e.g. 2to3-3.11) are symlinked to the native python
# installation but prevent the homebrew install from succeeding
# So we remove them
cd /usr/local/bin && rm -f 2to3* idle* pydoc* python*
brew update > /tmp/brew_update.log || { echo "::error::Updating homebrew failed"; cat /tmp/brew_update.log; exit 1; }
brew install hunspell poppler-qt5 lua qt@5
# As poppler-qt5 conflicts with poppler, we need to force-link it
brew link --force poppler-qt5
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' ${GITHUB_WORKSPACE} -DCMAKE_PREFIX_PATH="/usr/local/opt/qt@5"
- name: Build
run: make -j
working-directory: build
- name: Test
run: ctest -V
working-directory: build
################################################################################
build-macosx-macports:
name: Mac OS X (MacPorts)
runs-on: macos-latest
if: false
strategy:
matrix:
include:
- macports-version: 2.6.2
macports-platform: 10.15-Catalina
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install MacPorts
run: |
wget https://github.com/macports/macports-base/releases/download/v${{ matrix.macports-version }}/MacPorts-${{ matrix.macports-version }}-${{ matrix.macports-platform }}.pkg
sudo /usr/sbin/installer -pkg MacPorts-${{ matrix.macports-version }}-${{ matrix.macports-platform }}.pkg -target /
echo "::add-path::/opt/local/bin:/opt/local/sbin"
- name: Install Dependencies
run: sudo port selfupdate && sudo port install hunspell lua poppler-qt5 qt5-qtbase qt5-qtdeclarative qt5-qtscript qt5-qttools
- name: Configure
run: cmake -B build -DTW_BUILD_ID='github' ${GITHUB_WORKSPACE}
- name: Build
run: make -j
working-directory: build
- name: Test
run: ctest -V
working-directory: build