From 09c031fa961364a238a8da74fa3c328d1df3319c Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 15 Jul 2025 14:34:59 -0600 Subject: [PATCH] CI: Add nightly flatpak workflow This will build both aarch64 and x86_64 flatpaks nightly. The test jobs I did with the default GitHub runners took ~1h30m for aarch64 and ~2h30m for x86_64, but this will hopefully improve over time as the cache is built up. And be better time-wise on the blacksmith runners. Disk space is a large concern with these flatpak builds. A naive script on my local machine showed that we needed a max of 10.3 GiB of free space for the x86_64 build, with clang as the compiler. For some reason, building with default gcc 14 uses more disk space than that, bumping up against the default 14 GiB free space limit guaranteed by GitHub for their default runners. --- .github/workflows/flatpak-template.yml | 30 ++++++++++++++++++++++++++ .github/workflows/nightly-lagom.yml | 19 ++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/flatpak-template.yml diff --git a/.github/workflows/flatpak-template.yml b/.github/workflows/flatpak-template.yml new file mode 100644 index 00000000000..773bc489f97 --- /dev/null +++ b/.github/workflows/flatpak-template.yml @@ -0,0 +1,30 @@ +name: Flatpak Build + +on: + workflow_call: + inputs: + arch: + required: true + type: string + runner_labels: + required: true + type: string + +jobs: + flatpak: + runs-on: ${{ fromJSON(inputs.runner_labels) }} + + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.9 + options: --privileged + + steps: + - uses: actions/checkout@v4 + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: Ladybird.flatpak + manifest-path: Meta/CMake/flatpak/org.ladybird.Ladybird.json + cache: 'true' + arch: ${{ inputs.arch }} + # Note: default cache key is 'flatpak-builder-${arch}-${sha256(manifestPath)}' + upload-artifact: 'true' diff --git a/.github/workflows/nightly-lagom.yml b/.github/workflows/nightly-lagom.yml index 5850c4d65ee..201c5d3731e 100644 --- a/.github/workflows/nightly-lagom.yml +++ b/.github/workflows/nightly-lagom.yml @@ -77,3 +77,22 @@ jobs: arch: ${{ matrix.arch }} build_preset: ${{ matrix.build_preset }} clang_plugins: ${{ matrix.clang_plugins }} + + flatpak: + if: github.repository == 'LadybirdBrowser/ladybird' + name: Flatpak ${{ matrix.arch }} + strategy: + fail-fast: false + matrix: + arch: [ 'x86_64' ] + runner_labels: [ '["blacksmith-8vcpu-ubuntu-2404"]' ] + + include: + - arch: 'aarch64' + runner_labels: '["blacksmith-8vcpu-ubuntu-2404-arm"]' + + secrets: inherit + uses: ./.github/workflows/flatpak-template.yml + with: + arch: ${{ matrix.arch }} + runner_labels: ${{ matrix.runner_labels }}