Skip to content

Commit

Permalink
ci: Modernize the Github Actions workflow and (mostly) fix CI
Browse files Browse the repository at this point in the history
- Update the list of Linux distros to contain versions of Ubuntu
  that are currently supported. New baseline is Jammy Jellyfish
  (LTS 22.04).

- Update the checkout action to v4 to avoid deprecation warnings.

- Use an explicit action for ccache support, instead of caching
  manually. This simplifies quite some steps and should work
  more reliably.

- macos-latest (14) now builds on Apple Silicon (arm64). Build on
  both macOS 13 and latest so we get packages for both x86_64
  and arm64. Rename packages to contain the architecture, replacing
  the long outdated MacOSX name by macOS, too.
  Unfortunately, XCode 14.x is now the oldest version supported
  by Github, so we have to use this even though Qt does not
  officially support it (yet).

- Disable qca on macOS for the time being, as Homebrew no longer
  provides a Qt5 version of it. To be reenabled once Quassel has
  migrated to Qt6 as well.

- Pin Craft to qt5-lts for the time being, as master is moving to Qt6.

- However, the Windows builds are currently broken due to issues
  with Craft (or our configuration thereof). Make optional for now,
  until we find a solution.
  • Loading branch information
Sput42 committed Apr 28, 2024
1 parent 64faafb commit 2977a2e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 60 deletions.
5 changes: 1 addition & 4 deletions .craftsettings.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[General]
Command = craft
Branch = master
Branch = qt5-lts
ShallowClone = True

[GeneralSettings]
Version/ConfigVersion = 6

Paths/Python = C:\hostedtoolcache\windows\Python\3.7.7\x64
Paths/Python27 = C:\hostedtoolcache\windows\Python\2.7.18\x64
Paths/Msys = C:\msys64
ShortPath/Enabled = False
Compile/BuildType = Release
ContinuousIntegration/Enabled = True
Expand Down
81 changes: 26 additions & 55 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,31 @@ jobs:
strategy:
fail-fast: false
matrix:
dist: [ debian-stable, debian-testing, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-groovy ]
dist: [ debian-stable, debian-testing, ubuntu-jammy, ubuntu-mantic, ubuntu-noble ]
cxx: [ 'g++', 'clang++' ]
with-kde: [ -DWITH_KDE=ON ]
extra-options: [ -DWITH_WEBENGINE=ON ]
include:
# Baseline, test more combinations
- dist: ubuntu-xenial
- dist: ubuntu-jammy
with-kde: -DWITH_KDE=OFF
extra-options: -DWITH_WEBKIT=ON
- dist: ubuntu-xenial
- dist: ubuntu-jammy
with-kde: -DWITH_KDE=ON
extra-options: -DWITH_WEBKIT=ON
exclude:
# QtWebEngine is not available on Xenial
- dist: ubuntu-xenial
extra-options: -DWITH_WEBENGINE=ON
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 100M
CXX: ${{ matrix.cxx }}

steps:
- name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Get timestamp
id: get-timestamp
run: echo "::set-output name=timestamp::$(date -u "+%F-%R")"

- name: Setup ccache
uses: actions/cache@v2
uses: hendrikmuhs/ccache-action@v1.2
with:
path: ${{ github.workspace }}/ccache
key: ${{ matrix.dist }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.dist }}-ccache-
- name: Zero ccache stats
run: ccache -z
key: ${{ github.job }}-${{ matrix.dist }}-${{ matrix.cxx }}

- name: Configure
run: |
Expand All @@ -91,28 +74,25 @@ jobs:
- name: Install
run: cd build && DESTDIR=$GITHUB_WORKSPACE/image ninja install

- name: Print ccache stats
run: ccache -s

# ------------------------------------------------------------------------------------------------------------------------------------------
build-macos:
name: macOS
runs-on: macos-latest
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 100M
runs-on: macos-${{ matrix.osversion }}
strategy:
fail-fast: false
matrix:
osversion: [13, latest]

steps:
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
# Newer Xcode versions may not officially be supported by Qt
# Check https://doc.qt.io/qt-5/macos.html
xcode-version: '13.x'
xcode-version: '14.x'

- name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # so git-describe works
submodules: recursive
Expand All @@ -133,24 +113,15 @@ jobs:
# If Homebrew begins failing in the future due to out-of-date versions,
# it can be re-enabled here as follows...
# run: brew update && [below command]
run: brew install boost ccache ninja qca qt@5

- name: Get timestamp
id: get-timestamp
run: echo "::set-output name=timestamp::$(date -u "+%F-%R")"
run: brew install boost ccache ninja qt@5

- name: Setup ccache
uses: actions/cache@v2
uses: hendrikmuhs/ccache-action@v1.2
with:
path: ${{ github.workspace }}/ccache
key: macos-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: |
macos-ccache-
- name: Zero ccache stats
run: ccache -z
key: ${{ github.job }}-${{ matrix.osversion }}

- name: Configure
continue-on-error: true # Windows builds are broken atm
run: |
mkdir build
cd build && cmake $GITHUB_WORKSPACE \
Expand All @@ -166,6 +137,7 @@ jobs:
-DENABLE_SHARED=OFF \
-DBUNDLE=ON \
- name: Build
run: cd build && ninja

Expand All @@ -175,9 +147,6 @@ jobs:
- name: Install
run: cd build && ninja install

- name: Print ccache stats
run: ccache -s

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -188,13 +157,14 @@ jobs:
build-windows:
name: Windows
runs-on: windows-latest
continue-on-error: true
env:
WORKSPACE: ${{ github.workspace }}
CRAFT: /C/CraftMaster/windows-msvc2019_64-cl/craft/bin/craft.py

steps:
- name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # so git-describe works
submodules: recursive
Expand All @@ -204,7 +174,7 @@ jobs:
run: git fetch -f origin $GITHUB_REF:$GITHUB_REF

- name: Clone CraftMaster
run: git clone --depth=1 https://invent.kde.org/kde/craftmaster.git /C/CraftMaster/CraftMaster
run: git clone --depth=1 https://invent.kde.org/packaging/craftmaster.git /C/CraftMaster/CraftMaster

- name: Configure CraftMaster
run: python /C/CraftMaster/CraftMaster/CraftMaster.py --config $WORKSPACE/.craftsettings.ini --variables "WORKSPACE=$WORKSPACE"
Expand Down Expand Up @@ -243,7 +213,7 @@ jobs:

steps:
- name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -260,9 +230,10 @@ jobs:
run: ls -lhR artifacts

- name: Check artifacts
continue-on-error: true # Windows builds are broken atm
run: |
# Sanity check: We should have exactly 5 files matching the given patterns
[[ 5 -eq $(find artifacts/ \( -type f -name 'Quassel*.dmg' -o -name 'quassel*.exe' -o -name 'quassel*.7z' \) -printf '.' | wc -c) ]]
# Sanity check: We should have exactly 8 files matching the given patterns
[[ 8 -eq $(find artifacts/ \( -type f -name 'Quassel*.dmg' -o -name 'quassel*.exe' -o -name 'quassel*.7z' \) -printf '.' | wc -c) ]]
- name: Create release notes
if: startsWith(github.ref, 'refs/tags/')
Expand Down Expand Up @@ -291,7 +262,7 @@ jobs:
run: |
TAGNAME=$(git rev-parse --abbrev-ref $GITHUB_REF)
for type in Client Core Mono; do
mv artifacts/macOS/Quassel$type*.dmg assets/Quassel$type-macOS-$TAGNAME.dmg
mv artifacts/macOS/Quassel$type*.dmg assets/
done
mv artifacts/Windows/quassel-*.exe assets/quassel-windows-setup-$TAGNAME.exe
mv artifacts/Windows/quassel-*.7z assets/quassel-windows-$TAGNAME.7z
Expand Down
2 changes: 1 addition & 1 deletion cmake/QuasselMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function(quassel_add_executable _target)
# Prepare bundle creation on macOS
if(APPLE AND BUNDLE)
set(BUNDLE_PATH "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}.app")
set(DMG_PATH "${CMAKE_INSTALL_PREFIX}/Quassel${ARG_COMPONENT}_MacOSX-${CMAKE_OSX_ARCHITECTURES}_${QUASSEL_VERSION_STRING}.dmg")
set(DMG_PATH "${CMAKE_INSTALL_PREFIX}/Quassel${ARG_COMPONENT}_macOS-${CMAKE_OSX_ARCHITECTURES}_${QUASSEL_VERSION_STRING}.dmg")

# Generate an appropriate Info.plist
set(BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info_${ARG_COMPONENT}.plist")
Expand Down

1 comment on commit 2977a2e

@aicynide
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.