Browse Source

ci: Do not duplicate Flatpak manifest for CI

Instead use commands to modify the manifest before using it.
fractal-9
Kévin Commaille 2 years ago
parent
commit
2003b7bfae
No known key found for this signature in database
GPG Key ID: C971D9DBC9D678D
  1. 14
      .gitlab-ci/build.yml
  2. 17
      .gitlab-ci/nextest.module.json
  3. 53
      .gitlab-ci/org.gnome.Fractal.CiBuildStable.yml
  4. 66
      .gitlab-ci/org.gnome.Fractal.CiRust.yml
  5. 8
      .gitlab-ci/test.yml

14
.gitlab-ci/build.yml

@ -27,13 +27,19 @@ build@aarch64:
# Test builds with the stable runtime to make sure that the Flatpak will build on Flathub.
# Should be run manually before tagging a new release.
.build-stable:
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-46'
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-${GNOME_STABLE_VERSION}'
variables:
MANIFEST_PATH: ".gitlab-ci/org.gnome.Fractal.CiBuildStable.yml"
APP_ID: "org.gnome.Fractal.CiBuildStable"
GNOME_STABLE_VERSION: "46"
LLVM_NIGHTLY_VERSION: "18"
LLVM_STABLE_VERSION: "16"
RUNTIME_REPO: "https://flathub.org/repo/flathub.flatpakrepo"
BUNDLE: "${APP_ID}.flatpak"
RUN_TESTS: 0
before_script:
# We want to use the latest stable GNOME runtime instead of the nightly runtime.
- sed -i "s|master|${GNOME_STABLE_VERSION}|g" ${MANIFEST_PATH}
# We want to use the latest LLVM extension for the stable runtime.
- sed -i "s|llvm${LLVM_NIGHTLY_VERSION}|llvm${LLVM_STABLE_VERSION}|g" ${MANIFEST_PATH}
build-stable@x86_64:
extends:

17
.gitlab-ci/nextest.module.json

@ -0,0 +1,17 @@
{
"name": "cargo-nextest",
"buildsystem": "simple",
"sources": [
{
"type": "archive",
"url": "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.72/cargo-nextest-0.9.72-x86_64-unknown-linux-gnu.tar.gz",
"sha256": "e6f66397d3ba9a150b5debbc414a9ad1f87e4707da1f989c0681444ba5d15571",
"dest": "cargo-nextest",
"strip-components": 0
}
],
"build-commands": [
"mkdir /app/bin",
"mv cargo-nextest/cargo-nextest /app/bin/"
]
}

53
.gitlab-ci/org.gnome.Fractal.CiBuildStable.yml

@ -1,53 +0,0 @@
id: org.gnome.Fractal.CiBuildStable
runtime: org.gnome.Platform
runtime-version: '46'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.llvm16
command: fractal
finish-args:
- --socket=fallback-x11
- --socket=wayland
- --socket=pulseaudio
- --share=network
- --share=ipc
- --device=dri
build-options:
append-ld-library-path: /usr/lib/sdk/llvm16/lib
append-path: /usr/lib/sdk/llvm16/bin:/usr/lib/sdk/rust-stable/bin
build-args:
- --share=network
test-args:
- --socket=x11
- --share=network
modules:
- name: protobuf-c
buildsystem: autotools
config-opts:
- --disable-protoc
sources:
- type: git
url: https://github.com/protobuf-c/protobuf-c.git
tag: v1.5.0
commit: 8c201f6e47a53feaab773922a743091eb6c8972a
- name: libshumate
buildsystem: meson
config-opts:
- -Dgir=false
- -Dvapi=false
- -Dgtk_doc=false
- -Dvector_renderer=true
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libshumate.git
tag: 1.2.2
commit: fab290f36bb7043fe6107308ff4f91c80492aa11
- name: fractal
buildsystem: meson
run-tests: true
config-opts:
- -Dprofile=default
sources:
- type: dir
path: ../

66
.gitlab-ci/org.gnome.Fractal.CiRust.yml

@ -1,66 +0,0 @@
id: org.gnome.Fractal.CiRust
runtime: org.gnome.Platform
runtime-version: master
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.llvm18
command: fractal
finish-args:
- --socket=fallback-x11
- --socket=wayland
- --socket=pulseaudio
- --share=network
- --share=ipc
- --device=dri
build-options:
append-ld-library-path: /usr/lib/sdk/llvm18/lib
append-path: /usr/lib/sdk/llvm18/bin:/usr/lib/sdk/rust-stable/bin
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage="Arc"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage="Arc"
build-args:
- --share=network
test-args:
- --socket=x11
- --share=network
modules:
- name: cargo-nextest
buildsystem: simple
sources:
- type: archive
url: https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.72/cargo-nextest-0.9.72-x86_64-unknown-linux-gnu.tar.gz
sha256: e6f66397d3ba9a150b5debbc414a9ad1f87e4707da1f989c0681444ba5d15571
dest: cargo-nextest
strip-components: 0
build-commands:
- mkdir /app/bin
- mv cargo-nextest/cargo-nextest /app/bin/
- name: protobuf-c
buildsystem: autotools
config-opts:
- --disable-protoc
sources:
- type: git
url: https://github.com/protobuf-c/protobuf-c.git
tag: v1.5.0
commit: 8c201f6e47a53feaab773922a743091eb6c8972a
- name: libshumate
buildsystem: meson
config-opts:
- -Dgir=false
- -Dvapi=false
- -Dgtk_doc=false
- -Dvector_renderer=true
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libshumate.git
tag: 1.2.2
commit: fab290f36bb7043fe6107308ff4f91c80492aa11
- name: fractal
buildsystem: meson
sources:
- type: dir
path: ../

8
.gitlab-ci/test.yml

@ -24,10 +24,12 @@ rust-tests:
tags:
- flatpak
variables:
MANIFEST_PATH: ".gitlab-ci/org.gnome.Fractal.CiRust.yml"
TMP_MANIFEST_PATH: "build-aux/org.gnome.Fractal.CiRust.json"
script:
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
- echo "cargo-nextest nextest run --config-file ../.gitlab-ci/nextest.toml" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
# Add a module for nextest to the Flatpak manifest
- jq --slurpfile nextest .gitlab-ci/nextest.module.json '.modules = [$nextest[], .modules[]]' ${MANIFEST_PATH} > ${TMP_MANIFEST_PATH}
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${TMP_MANIFEST_PATH}
- echo "cargo-nextest nextest run --config-file ../.gitlab-ci/nextest.toml" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${TMP_MANIFEST_PATH}
dependencies: []
artifacts:
reports:

Loading…
Cancel
Save