gitlabci: Use flatpak for the CI build test.

This commit is contained in:
Jordan Petridis 2018-03-19 12:49:11 +02:00
parent b3e7d645e2
commit 167530fada
No known key found for this signature in database
GPG key ID: CEABAD9F5683B9A6
2 changed files with 32 additions and 36 deletions

View file

@ -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
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
.cargo_test_template: &cargo_test
stage: test stage: test
script: before_script:
- rustc --version && cargo --version # same thing as https://gitlab.gnome.org/alatiera/Hammond/issues/55
- dnf install -y glib2-devel
# Force regeneration of gresources regardless of artifacts chage # Force regeneration of gresources regardless of artifacts chage
- cd fractal-gtk/res/ && glib-compile-resources --generate resources.xml && cd ../../ - cd fractal-gtk/res/ && glib-compile-resources --generate resources.xml && cd ../../
- cargo build script:
- cargo test --verbose -- --test-threads=1 # Build the flatpak repo
# cache: - flatpak-builder --stop-at=fractal app flatpak/org.gnome.Fractal.json
# paths: - flatpak-builder --run app flatpak/org.gnome.Fractal.json meson --prefix=/app --libdir=/app/lib _build
# - target/ - flatpak-builder --run app flatpak/org.gnome.Fractal.json ninja -C _build install
# - cargo/ - flatpak-builder --finish-only app flatpak/org.gnome.Fractal.json
- flatpak build-export repo app
test:stable: # Create a flatpak bundle for designers to use
# Stable img - flatpak build-bundle repo fractal-dev.flatpak org.gnome.Fractal
# https://hub.docker.com/_/rust/ # Run the tests
image: "rust" - flatpak-builder --run app flatpak/org.gnome.Fractal.json cargo test
<<: *cargo_test
# test:nightly: artifacts:
# # Nightly paths:
# # https://hub.docker.com/r/rustlang/rust/ - fractal-dev.flatpak
# image: "rustlang/rust:nightly" expire_in: 2 days
# <<: *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/

View file

@ -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" : [
{ {