gitlabci: Use flatpak for the CI build test.
This commit is contained in:
parent
b3e7d645e2
commit
167530fada
2 changed files with 32 additions and 36 deletions
|
@ -1,39 +1,38 @@
|
|||
stages:
|
||||
- test
|
||||
|
||||
variables:
|
||||
RUST_BACKTRACE: "FULL"
|
||||
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
||||
flatpak:
|
||||
image: registry.gitlab.com/alatiera/gnome-nightly-oci/rust-bundle:latest
|
||||
stage: test
|
||||
before_script:
|
||||
# same thing as https://gitlab.gnome.org/alatiera/Hammond/issues/55
|
||||
- dnf install -y glib2-devel
|
||||
# Force regeneration of gresources regardless of artifacts chage
|
||||
- cd fractal-gtk/res/ && glib-compile-resources --generate resources.xml && cd ../../
|
||||
script:
|
||||
# Build the flatpak repo
|
||||
- flatpak-builder --stop-at=fractal app flatpak/org.gnome.Fractal.json
|
||||
- flatpak-builder --run app flatpak/org.gnome.Fractal.json meson --prefix=/app --libdir=/app/lib _build
|
||||
- flatpak-builder --run app flatpak/org.gnome.Fractal.json ninja -C _build install
|
||||
- flatpak-builder --finish-only app flatpak/org.gnome.Fractal.json
|
||||
- flatpak build-export repo app
|
||||
|
||||
before_script:
|
||||
- apt-get update -yqq
|
||||
- apt-get install -yqq --no-install-recommends build-essential
|
||||
- apt-get install -yqq --no-install-recommends libgtk-3-dev
|
||||
- apt-get install -yqq libgmp-dev
|
||||
# - apt-get install -yqq --no-install-recommends meson
|
||||
# Create a flatpak bundle for designers to use
|
||||
- flatpak build-bundle repo fractal-dev.flatpak org.gnome.Fractal
|
||||
# Run the tests
|
||||
- flatpak-builder --run app flatpak/org.gnome.Fractal.json cargo test
|
||||
|
||||
.cargo_test_template: &cargo_test
|
||||
stage: test
|
||||
script:
|
||||
- rustc --version && cargo --version
|
||||
# Force regeneration of gresources regardless of artifacts chage
|
||||
- cd fractal-gtk/res/ && glib-compile-resources --generate resources.xml && cd ../../
|
||||
- cargo build
|
||||
- cargo test --verbose -- --test-threads=1
|
||||
# cache:
|
||||
# paths:
|
||||
# - target/
|
||||
# - cargo/
|
||||
artifacts:
|
||||
paths:
|
||||
- fractal-dev.flatpak
|
||||
expire_in: 2 days
|
||||
|
||||
test:stable:
|
||||
# Stable img
|
||||
# https://hub.docker.com/_/rust/
|
||||
image: "rust"
|
||||
<<: *cargo_test
|
||||
|
||||
# test:nightly:
|
||||
# # Nightly
|
||||
# # https://hub.docker.com/r/rustlang/rust/
|
||||
# image: "rustlang/rust:nightly"
|
||||
# <<: *cargo_test
|
||||
cache:
|
||||
# JOB_NAME - Each job will have it's own cache
|
||||
# COMMIT_REF_SLUG = Lowercase name of the branch
|
||||
# ^ Keep diffrerent caches for each branch
|
||||
key: "$CI_JOB_NAME"
|
||||
paths:
|
||||
- .flatpak-builder/cache/
|
||||
- target/
|
||||
|
||||
|
|
|
@ -12,12 +12,10 @@
|
|||
],
|
||||
"desktop-file-name-prefix" : "(Nightly) ",
|
||||
"finish-args" : [
|
||||
/** dconf permission for GtkInspector **/
|
||||
"--filesystem=xdg-run/dconf",
|
||||
"--filesystem=~/.config/dconf:ro",
|
||||
"--talk-name=ca.desrt.dconf",
|
||||
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
|
||||
|
||||
"--share=network",
|
||||
"--share=ipc",
|
||||
"--socket=x11",
|
||||
|
@ -28,7 +26,6 @@
|
|||
],
|
||||
"build-options" : {
|
||||
"append-path" : "/usr/lib/sdk/rust-stable/bin",
|
||||
/** Network needed for cargo deps **/
|
||||
"build-args" : [
|
||||
"--share=network"
|
||||
],
|
||||
|
@ -39,7 +36,7 @@
|
|||
},
|
||||
"modules" : [
|
||||
{
|
||||
"name" : "Fractal",
|
||||
"name" : "fractal",
|
||||
"buildsystem" : "meson",
|
||||
"sources" : [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue