Skip to content

hack: Install libxml2, libxslt, harfbuzz, zlib on macOS from Conan #521

hack: Install libxml2, libxslt, harfbuzz, zlib on macOS from Conan

hack: Install libxml2, libxslt, harfbuzz, zlib on macOS from Conan #521

Workflow file for this run

name: CMake Build Matrix
on:
push:
branches:
- master
- qt6
pull_request:
branches:
- master
env:
QT_VERSION: 5.15.2
CCACHE_VERSION: 4.7.3
CACHE_PARTITION: dev
NINJA_STATUS: "[%f/%t %o/sec] "
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "250M"
CCACHE_SLOPPINESS: "pch_defines,time_macros"
CCACHE_HARDLINK: "true"
QT_MODULES: "qtbase qtdeclarative qtlocation qtmultimedia qtsensors qtwebchannel"
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Release", artifact: "Linux",
os: ubuntu-latest,
build_type: Release,
host_n_cores: 2,
}
- {
name: "macOS Release", artifact: "macOS",
os: macos-latest,
host_n_cores: 3,
build_type: Release,
}
- {
name: "Windows MSVC Conan Release", artifact: "Windows-MSVC",
os: windows-latest,
build_type: Release,
host_n_cores: 2,
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10
sparse-checkout: |
/*
!LayoutTests
sparse-checkout-cone-mode: false
- uses: actions/setup-python@v4
if: runner.os == 'Windows' || runner.os == 'macOS'
with:
python-version: '3.10'
- uses: BSFishy/pip-action@v1
if: runner.os == 'Windows' || runner.os == 'macOS'
with:
requirements: Tools/qt/qt-downloader-requirements.txt
packages: |
conan<2
- name: Download Qt Windows
id: qt_win
if: runner.os == 'Windows'
env:
TOOLCHAIN: "win64_msvc2019_64"
DIR: "msvc2019_64"
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
QT_INSTALL_DIR="/c/Qt"
py Tools/qt/qt-downloader windows desktop ${QT_VERSION} ${TOOLCHAIN} --output=${QT_INSTALL_DIR} --qt_modules="${QT_MODULES}"
export QTDIR="${QT_INSTALL_DIR}/${QT_VERSION}/${DIR}"
ls $QTDIR
Tools/qt/license_writer.sh
QTWINDIR="C:\\Qt\\${QT_VERSION}\\${DIR}"
echo "qt_dir=${QTWINDIR}" >> $GITHUB_OUTPUT
- name: Download Qt Mac
id: qt_mac
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
env:
TOOLCHAIN: "clang_64"
run: |
QT_INSTALL_DIR="${PWD}/Qt"
Tools/qt/qt-downloader macos desktop ${QT_VERSION} ${TOOLCHAIN} --output=${QT_INSTALL_DIR} --qt_modules="${QT_MODULES}"
export QTDIR="${QT_INSTALL_DIR}/${QT_VERSION}/${TOOLCHAIN}"
ls $QTDIR
Tools/qt/license_writer.sh
echo "qt_dir=${QTDIR}" >> $GITHUB_OUTPUT
- name: Download ccache
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
- name: ccache cache files
uses: annulen/cache-action@v3.3.1-custom
with:
path: .ccache
key: ${{ matrix.config.name }}-ccache-${{ env.CACHE_PARTITION }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.config.name }}-ccache-${{ env.CACHE_PARTITION }}-
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install \
ninja-build build-essential bison flex gperf libfontconfig1-dev libgl1-mesa-dev libglib2.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhyphen-dev libicu-dev libjpeg-dev libpng-dev libqt5opengl5-dev libqt5sensors5-dev libqt5webchannel5-dev libsqlite3-dev libwebp-dev libwoff-dev libxcomposite-dev libxml2-dev libxrender-dev libxslt1-dev mesa-common-dev pkg-config python3 qtbase5-private-dev qtdeclarative5-private-dev qtpositioning5-dev ruby libqt5sql5-sqlite qtbase5-doc-html qttools5-dev-tools \
libtasn1-6-dev libgcrypt20-dev libunwind-dev libharfbuzz-dev
- name: CMake version
id: cmake_version
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
cmake --version
- name: CMake environment
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV
echo "cmake_args='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_PCH=OFF'" >> $GITHUB_ENV
- name: Configure (Linux)
if: runner.os == 'Linux'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: cmake $cmake_args -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
- name: Configure (MSVC)
if: runner.os == 'Windows' && matrix.config.environment_script != ''
shell: cmd
run: py Tools\qt\build-qtwebkit-conan.py --configure --cmakeargs="%cmake_args%" --qt="${{ steps.qt_win.outputs.qt_dir }}" || exit /b 1
- name: Configure (macOS/Conan)
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: Tools/qt/build-qtwebkit-conan.py --configure --cmakeargs="$cmake_args" --qt="${{ steps.qt_mac.outputs.qt_dir }}"
- uses: actions/upload-artifact@v1
with:
path: build/CMakeCache.txt
name: CMakeCache.txt
#
# - uses: actions/upload-artifact@v1
# with:
# path: build/build.ninja
# name: build.ninja
#
# - uses: actions/upload-artifact@v1
# if: runner.os == 'Windows' || runner.os == 'macOS'
# with:
# path: build/conanbuildinfo.cmake
# name: conanbuildinfo.cmake
- name: ccache configuration
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
ccache -p
ccache -z
- name: Build (Linux)
if: runner.os == 'Linux'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: ninja -C build -j ${{ matrix.config.host_n_cores }} -v
- name: Build (MSVC/Conan)
if: runner.os == 'Windows' && matrix.config.environment_script != ''
shell: cmd
run: py Tools\qt\build-qtwebkit-conan.py --build --install --ninjaargs="-j ${{ matrix.config.host_n_cores }} -v" || exit /b 1
- name: Build (macOS/Conan)
if: runner.os == 'macOS'
shell: bash --noprofile --norc -eo pipefail -x {0}
run: Tools/qt/build-qtwebkit-conan.py --build --install --ninjaargs="-j ${{ matrix.config.host_n_cores }} -v"
# - name: Verify (Linux)
# if: runner.os == 'Linux'
# shell: bash --noprofile --norc -eo pipefail -x {0}
# run: pip3 install jinja2 && Tools/qt/installed-files-checker.py --version 5.212.0 --os linux --template=Tools/qt/QtBinaryChecklist.txt --release --verbose
# - name: Verify (Mac)
# if: runner.os == 'macOS'
# shell: bash --noprofile --norc -eo pipefail -x {0}
# run: pip3 install jinja2 && Tools/qt/installed-files-checker.py --version=5.212.0 --os=macos --install_prefix="${{ steps.qt_mac.outputs.qt_dir }}" --template=Tools/qt/QtBinaryChecklist.txt --release --verbose
#
# - name: Verify (Windows)
# if: runner.os == 'Windows'
# shell: cmd
# run: py -m pip install jinja2 && py Tools\qt\installed-files-checker.py --version=5.212.0 --os=windows --install_prefix="${{ steps.qt_win.outputs.qt_dir }}" --icu_version=65 --toolchain=msvc --template=Tools\qt\QtBinaryChecklist.txt --release --verbose
- name: ccache stats
if: always()
shell: bash --noprofile --norc -eo pipefail -x {0}
run: ccache -s