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:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
|
||||||
variables:
|
flatpak:
|
||||||
RUST_BACKTRACE: "FULL"
|
image: registry.gitlab.com/alatiera/gnome-nightly-oci/rust-bundle:latest
|
||||||
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
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:
|
# Create a flatpak bundle for designers to use
|
||||||
- apt-get update -yqq
|
- flatpak build-bundle repo fractal-dev.flatpak org.gnome.Fractal
|
||||||
- apt-get install -yqq --no-install-recommends build-essential
|
# Run the tests
|
||||||
- apt-get install -yqq --no-install-recommends libgtk-3-dev
|
- flatpak-builder --run app flatpak/org.gnome.Fractal.json cargo test
|
||||||
- apt-get install -yqq libgmp-dev
|
|
||||||
# - apt-get install -yqq --no-install-recommends meson
|
|
||||||
|
|
||||||
.cargo_test_template: &cargo_test
|
artifacts:
|
||||||
stage: test
|
paths:
|
||||||
script:
|
- fractal-dev.flatpak
|
||||||
- rustc --version && cargo --version
|
expire_in: 2 days
|
||||||
# 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/
|
|
||||||
|
|
||||||
test:stable:
|
cache:
|
||||||
# Stable img
|
# JOB_NAME - Each job will have it's own cache
|
||||||
# https://hub.docker.com/_/rust/
|
# COMMIT_REF_SLUG = Lowercase name of the branch
|
||||||
image: "rust"
|
# ^ Keep diffrerent caches for each branch
|
||||||
<<: *cargo_test
|
key: "$CI_JOB_NAME"
|
||||||
|
paths:
|
||||||
# test:nightly:
|
- .flatpak-builder/cache/
|
||||||
# # Nightly
|
- target/
|
||||||
# # https://hub.docker.com/r/rustlang/rust/
|
|
||||||
# image: "rustlang/rust:nightly"
|
|
||||||
# <<: *cargo_test
|
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,10 @@
|
||||||
],
|
],
|
||||||
"desktop-file-name-prefix" : "(Nightly) ",
|
"desktop-file-name-prefix" : "(Nightly) ",
|
||||||
"finish-args" : [
|
"finish-args" : [
|
||||||
/** dconf permission for GtkInspector **/
|
|
||||||
"--filesystem=xdg-run/dconf",
|
"--filesystem=xdg-run/dconf",
|
||||||
"--filesystem=~/.config/dconf:ro",
|
"--filesystem=~/.config/dconf:ro",
|
||||||
"--talk-name=ca.desrt.dconf",
|
"--talk-name=ca.desrt.dconf",
|
||||||
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
|
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
|
||||||
|
|
||||||
"--share=network",
|
"--share=network",
|
||||||
"--share=ipc",
|
"--share=ipc",
|
||||||
"--socket=x11",
|
"--socket=x11",
|
||||||
|
@ -28,7 +26,6 @@
|
||||||
],
|
],
|
||||||
"build-options" : {
|
"build-options" : {
|
||||||
"append-path" : "/usr/lib/sdk/rust-stable/bin",
|
"append-path" : "/usr/lib/sdk/rust-stable/bin",
|
||||||
/** Network needed for cargo deps **/
|
|
||||||
"build-args" : [
|
"build-args" : [
|
||||||
"--share=network"
|
"--share=network"
|
||||||
],
|
],
|
||||||
|
@ -39,7 +36,7 @@
|
||||||
},
|
},
|
||||||
"modules" : [
|
"modules" : [
|
||||||
{
|
{
|
||||||
"name" : "Fractal",
|
"name" : "fractal",
|
||||||
"buildsystem" : "meson",
|
"buildsystem" : "meson",
|
||||||
"sources" : [
|
"sources" : [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue