fractal/.gitlab-ci.yml

115 lines
3.2 KiB
YAML
Raw Normal View History

2017-11-12 11:32:08 +00:00
stages:
- test
- review
2018-05-14 19:12:07 +00:00
- deploy
2017-11-12 11:32:08 +00:00
variables:
BUNDLE: "org.gnome.Fractal.${CI_COMMIT_SHA}.flatpak"
2018-08-18 16:48:50 +00:00
MANIFEST_PATH: "flatpak/org.gnome.Fractal.json"
MANIFEST_PATH: "flatpak/org.gnome.Fractal.json"
FLATPAK_MODULE: "fractal"
DBUS_ID: "org.gnome.Fractal"
2018-08-18 17:20:07 +00:00
.flatpak_cache_template: &flatpak_cache
2018-08-18 16:48:50 +00:00
cache:
key: "flatpak"
paths:
- .flatpak-builder/cache/
- target/
- target_docs/
- target_test/
flatpak:
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
stage: "test"
script:
2018-08-18 16:48:50 +00:00
- flatpak-builder --stop-at=${FLATPAK_MODULE} --force-clean app ${MANIFEST_PATH}
# Force regeneration of gresources regardless of artifacts chage
- flatpak-builder --run app ${MANIFEST_PATH} glib-compile-resources --sourcedir=fractal-gtk/res/ fractal-gtk/res/resources.xml
# Build the flatpak repo
- flatpak-builder --run app ${MANIFEST_PATH} meson --prefix=/app _build
- flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build install
2017-12-22 20:22:32 +00:00
# Run the tests
- |
xvfb-run -a -s "-screen 0 1024x768x24" \
flatpak-builder --run \
--env=CARGO_HOME="target/cargo-home" \
--env=CARGO_TARGET_DIR="target_test/" \
app ${MANIFEST_PATH} \
cargo test
# Create a flatpak bundle
- flatpak-builder --finish-only app ${MANIFEST_PATH}
- flatpak build-export repo app
- flatpak build-bundle repo ${BUNDLE} ${DBUS_ID}
2017-11-12 11:32:08 +00:00
artifacts:
paths:
- $BUNDLE
expire_in: 2 days
2018-08-18 16:48:50 +00:00
<<: *flatpak_cache
2017-11-12 11:32:08 +00:00
review:
stage: review
dependencies:
- flatpak
script:
- echo "Generating flatpak deployment"
artifacts:
paths:
- $BUNDLE
expire_in: 30 days
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
on_stop: stop_review
except:
- master@World/fractal
- tags
stop_review:
stage: review
script:
- echo "Stopping flatpak deployment"
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
except:
- master@World/fractal
- tags
2017-11-12 11:32:08 +00:00
2018-08-18 16:48:50 +00:00
pages:
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
2018-05-14 18:58:42 +00:00
stage: deploy
script:
2018-08-18 16:48:50 +00:00
- flatpak-builder --stop-at=${FLATPAK_MODULE} --force-clean app ${MANIFEST_PATH}
# Force regeneration of gresources regardless of artifacts chage
- flatpak-builder --run app ${MANIFEST_PATH} glib-compile-resources --sourcedir=fractal-gtk/res/ fractal-gtk/res/resources.xml
- |
flatpak-builder --run \
--env=CARGO_HOME="target/cargo-home" \
app ${MANIFEST_PATH} \
cargo doc --no-deps
- |
flatpak-builder --run \
--env=CARGO_HOME="target/cargo-home" \
app ${MANIFEST_PATH} \
cargo rustdoc -p fractal-gtk -- --document-private-items
2018-05-18 19:04:12 +00:00
2018-05-14 18:58:42 +00:00
- rm -rf public
- mv target/doc/ public
artifacts:
paths:
- public
2018-08-18 16:48:50 +00:00
only:
- master
<<: *flatpak_cache