Skip to content

Commit

Permalink
CI: consolidate the CI builds into a single matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
danvratil committed May 5, 2022
1 parent 60c235d commit 65108c4
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 252 deletions.
32 changes: 32 additions & 0 deletions .github/actions/install-compiler/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Install Compiler
description: Installs compiler
inputs:
compiler:
description: Compiler to install (gcc|clang)
required: true
version:
description: Version of compiler to install
required: true

runs:
using: composite
steps:
- name: Install GCC
if: ${{ inputs.compiler == 'gcc' }}
shell: bash
run: |
GCC_VERSION_MAJOR=$(echo ${{ inputs.version }} | cut -d '.' -f1)
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/ubuntu-toolchain-r/ppa/ubuntu focal main"
sudo apt-get update
sudo apt-get install -y \
gcc-${GCC_VERSION_MAJOR} g++-${GCC_VERSION_MAJOR} libstdc++-${GCC_VERSION_MAJOR}-dev
echo "CXX=/usr/bin/g++-${GCC_VERSION_MAJOR}" >> $GITHUB_ENV
- name: Install Clang
if : ${{ inputs.compiler == 'clang' }}
shell: bash
run: |
wget https://apt.llvm.org/llvm.sh -O llvm.sh
chmod a+x llvm.sh
sed -i "s/libunwind-\$LLVM_VERSION-dev//" llvm.sh
sudo ./llvm.sh ${{ inputs.version }} all
echo "CXX=/usr/bin/clang++-${{ inputs.version }}" >> $GITHUB_ENV
81 changes: 47 additions & 34 deletions .github/actions/install-qt/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,59 @@ inputs:
qt_modules:
description: 'List of Qt modules to intall'
default: qtbase icu
compiler:
description: 'Name of the compiler to use'
platform:
description: 'Operating system (linux|windows|macos)'
required: true
runs:
using: composite
steps:
- shell: bash
- name: Install dependencies
if: ${{ inputs.platform == 'linux' }}
shell: bash
run: |
if [[ "${{ inputs.compiler }}" == "msvc" ]]; then
pip3 install aqtinstall~=2.1
aqt install-qt -O C:\Qt windows desktop ${{ inputs.qt_version }} win64_msvc2019_64 --archives ${{ inputs.qt_modules }}
QT_BASE_DIR="C:\Qt\${{ inputs.qt_version }}\msvc2019_64"
powershell "./.github/actions/install-qt/install-dbus.ps1" "$QT_BASE_DIR"
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
python3 python3-pip \
build-essential \
dbus dbus-x11 \
libgl-dev libegl-dev
- name: Install Qt
shell: bash
run: |
pip3 install aqtinstall~=2.1
case "${{ inputs.platform }}" in
"windows")
QT_ARCH="win64_msvc2019_64"
QT_INSTALL_PATH="C:\\Qt"
QT_BASE_DIR="${QT_INSTALL_PATH}\\${{ inputs.qt_version }}\\msvc2019_64"
QT_OS="windows"
;;
"linux")
QT_ARCH="gcc_64"
QT_INSTALL_PATH="/opt/qt"
QT_BASE_DIR="${QT_INSTALL_PATH}/${{ inputs.qt_version }}/${QT_ARCH}"
QT_OS="linux"
;;
"macos")
QT_ARCH=""
QT_INSTALL_PATH="/Users/runner/qt"
if [[ "$(echo ${{ inputs.qt_version }} | cut -d'.' -f1)" == "6" ]]; then
QT_BASE_DIR="${QT_INSTALL_PATH}/${{ inputs.qt_version }}/macos"
else
QT_BASE_DIR="${QT_INSTALL_PATH}/${{ inputs.qt_version }}/clang_64"
fi
QT_OS="mac"
;;
esac
echo "$QT_BASE_DIR\\bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$QT_BASE_DIR\\lib\\cmake" >> $GITHUB_ENV
elif [[ "${{ inputs.compiler }}" == "apple-clang" ]]; then
pip3 install aqtinstall~=2.1
aqt install-qt -O /Users/runner/qt mac desktop ${{ inputs.qt_version }} --archives ${{ inputs.qt_modules }}
aqt install-qt -O ${QT_INSTALL_PATH} ${QT_OS} desktop ${{ inputs.qt_version }} ${QT_ARCH} --archives ${{ inputs.qt_modules }}
if [[ "$(echo ${{ inputs.qt_version }} | cut -d'.' -f1)" == "6" ]]; then
QT_BASE_DIR="/Users/runner/qt/${{ inputs.qt_version }}/macos"
else
QT_BASE_DIR="/Users/runner/qt/${{ inputs.qt_version }}/clang_64"
fi
echo "$QT_BASE_DIR/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$QT_BASE_DIR/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "XDG_DATA_DIRS=$QT_BASE_DIR/share:$XDG_DATA_DIRS" >> $GITHUB_ENV
else
sudo apt-get update
sudo apt-get install -y --no-install-recommends python3 python3-pip build-essential dbus dbus-x11 libgl-dev libegl-dev
pip3 install aqtinstall~=2.1
if [[ "${{ inputs.compiler }}" == "clang"* ]]; then
sudo apt-get install -y --no-install-recommends libc++1-11 libc++-11-dev libc++abi-11-dev
fi
aqt install-qt -O /opt/qt linux desktop ${{ inputs.qt_version }} gcc_64 --archives ${{ inputs.qt_modules }}
echo "${QT_BASE_DIR}/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=${QT_BASE_DIR}/lib/cmake" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${QT_BASE_DIR}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
echo "XDG_DATA_DIRS=${QT_BASE_DIR}/share:${XDG_DATA_DIRS}" >> $GITHUB_ENV
QT_BASE_DIR="/opt/qt/${{ inputs.qt_version }}/gcc_64/"
echo "$QT_BASE_DIR/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=$QT_BASE_DIR/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "XDG_DATA_DIRS=$QT_BASE_DIR/share:$XDG_DATA_DIRS" >> $GITHUB_ENV
if [[ "${{ inputs.platform }}" == "windows" ]]; then
powershell "./.github/actions/install-qt/install-dbus.ps1" "$QT_BASE_DIR"
fi
2 changes: 1 addition & 1 deletion .github/actions/install-qt/install-dbus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name 'PSGallery' -SourceLocation "https://www.powershellgallery.com/api/v2" -InstallationPolicy Trusted
Install-Module -Name 7Zip4PowerShell -Force

curl https://files.kde.org/craft/master/Qt_5.15.2-1/windows/msvc2019_64/cl/RelWithDebInfo/libs/dbus/dbus-1.13.18-3-131-20210415T121131-windows-msvc2019_64-cl.7z -o C:\Qt\dbus.7z
Invoke-WebRequest -Uri https://files.kde.org/craft/master/22.05/windows/msvc2019_64/cl/RelWithDebInfo/libs/dbus/dbus-1.14.0-178-20220428T163337-windows-msvc2019_64-cl.7z -OutFile C:\Qt\dbus.7z
Expand-7Zip -ArchiveFileName C:\Qt\dbus.7z -TargetPath $args[0]

Loading

0 comments on commit 65108c4

Please sign in to comment.