2017-11-12 11:32:08 +00:00
|
|
|
stages:
|
2018-11-27 19:57:35 +00:00
|
|
|
- check
|
2017-11-12 11:32:08 +00:00
|
|
|
- test
|
2018-08-18 15:47:15 +00:00
|
|
|
- review
|
2018-05-14 19:12:07 +00:00
|
|
|
- deploy
|
2017-11-12 11:32:08 +00:00
|
|
|
|
2018-08-18 15:47:15 +00:00
|
|
|
variables:
|
2018-08-24 12:43:11 +00:00
|
|
|
BUNDLE: "org.gnome.FractalDevel.flatpak"
|
2018-08-18 16:48:50 +00:00
|
|
|
MANIFEST_PATH: "flatpak/org.gnome.Fractal.json"
|
|
|
|
FLATPAK_MODULE: "fractal"
|
2018-08-23 23:19:20 +00:00
|
|
|
DBUS_ID: "org.gnome.FractalDevel"
|
2018-08-18 16:48:50 +00:00
|
|
|
|
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/
|
2019-04-22 05:54:26 +00:00
|
|
|
- _build/target/
|
2018-08-18 16:48:50 +00:00
|
|
|
- target_docs/
|
|
|
|
- target_test/
|
|
|
|
|
2018-11-27 19:57:35 +00:00
|
|
|
check:
|
2019-02-02 19:32:22 +00:00
|
|
|
image: "registry.gitlab.com/alatiera/rustfmt-oci-image/rustfmt:stable"
|
2018-11-27 19:57:35 +00:00
|
|
|
stage: "check"
|
|
|
|
script:
|
2019-04-22 05:58:57 +00:00
|
|
|
# Create blank versions of our configured files
|
|
|
|
# so rustfmt does not yell about non-existent files or completely empty files
|
|
|
|
- echo -e "" >> fractal-gtk/src/config.rs
|
|
|
|
- echo -e "" >> fractal-gtk/src/static_resources.rs
|
2018-11-27 19:57:35 +00:00
|
|
|
- rustc -Vv && cargo -Vv
|
2019-02-02 19:32:22 +00:00
|
|
|
- cargo --version
|
|
|
|
- cargo fmt --all -- --check
|
2018-08-18 15:47:15 +00:00
|
|
|
|
2018-03-19 10:49:11 +00:00
|
|
|
flatpak:
|
2018-08-18 15:47:15 +00:00
|
|
|
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}
|
2018-04-05 17:58:57 +00:00
|
|
|
|
2018-08-18 15:47:15 +00:00
|
|
|
# Build the flatpak repo
|
2018-08-23 23:19:20 +00:00
|
|
|
- flatpak-builder --run app ${MANIFEST_PATH} meson --prefix=/app -Dprofile=development _build
|
2018-08-18 15:47:15 +00:00
|
|
|
- flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build install
|
2017-12-22 20:22:32 +00:00
|
|
|
|
2018-03-19 10:49:11 +00:00
|
|
|
# Run the tests
|
2018-08-18 15:47:15 +00:00
|
|
|
- |
|
|
|
|
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} \
|
2019-04-22 16:00:05 +00:00
|
|
|
ninja -C _build test
|
2018-08-18 15:47:15 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
2018-03-19 10:49:11 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2018-08-24 12:43:11 +00:00
|
|
|
- "${BUNDLE}"
|
2018-03-19 10:49:11 +00:00
|
|
|
expire_in: 2 days
|
2018-08-18 16:48:50 +00:00
|
|
|
<<: *flatpak_cache
|
2017-11-12 11:32:08 +00:00
|
|
|
|
2018-08-18 15:47:15 +00:00
|
|
|
|
|
|
|
review:
|
|
|
|
stage: review
|
|
|
|
dependencies:
|
|
|
|
- flatpak
|
|
|
|
script:
|
|
|
|
- echo "Generating flatpak deployment"
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2018-08-24 12:43:11 +00:00
|
|
|
- "${BUNDLE}"
|
2018-08-18 15:47:15 +00:00
|
|
|
expire_in: 30 days
|
|
|
|
environment:
|
2018-08-24 12:43:11 +00:00
|
|
|
name: "review/${CI_COMMIT_REF_NAME}"
|
|
|
|
url: "https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}"
|
2018-08-18 15:47:15 +00:00
|
|
|
on_stop: stop_review
|
|
|
|
except:
|
2018-12-28 11:44:30 +00:00
|
|
|
- master@GNOME/fractal
|
2018-08-18 15:47:15 +00:00
|
|
|
- tags
|
|
|
|
|
|
|
|
stop_review:
|
|
|
|
stage: review
|
|
|
|
script:
|
|
|
|
- echo "Stopping flatpak deployment"
|
|
|
|
when: manual
|
|
|
|
environment:
|
2018-08-24 12:43:11 +00:00
|
|
|
name: "review/${CI_COMMIT_REF_NAME}"
|
2018-08-18 15:47:15 +00:00
|
|
|
action: stop
|
|
|
|
except:
|
2018-12-28 11:44:30 +00:00
|
|
|
- master@GNOME/fractal
|
2018-08-18 15:47:15 +00:00
|
|
|
- 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}
|
2019-04-22 04:51:21 +00:00
|
|
|
- flatpak-builder --run app ${MANIFEST_PATH} meson _build
|
2018-08-18 16:48:50 +00:00
|
|
|
|
2019-04-28 19:12:59 +00:00
|
|
|
- flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build doc
|
2018-05-18 19:04:12 +00:00
|
|
|
|
2018-05-14 18:58:42 +00:00
|
|
|
- rm -rf public
|
2019-04-28 19:12:59 +00:00
|
|
|
- mv _build/target/doc/ public
|
2018-05-14 18:58:42 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
2018-08-18 16:48:50 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
<<: *flatpak_cache
|