Gitlab CI zips its cache target which causes it to strip xattributes. This breaks ostree and the cache artifacts. Cache only the sources instead.
97 lines
2.9 KiB
YAML
97 lines
2.9 KiB
YAML
stages:
|
|
- test
|
|
- lint
|
|
- review
|
|
|
|
variables:
|
|
BUNDLE: "org.gnome.Podcasts.${CI_COMMIT_SHA}.flatpak"
|
|
|
|
flatpak:
|
|
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
|
|
stage: "test"
|
|
variables:
|
|
MANIFEST_PATH: "org.gnome.PodcastsDevel.json"
|
|
FLATPAK_MODULE: "gnome-podcasts"
|
|
CONFIGURE_ARGS: "-Dprofile=development"
|
|
DBUS_ID: "org.gnome.PodcastsDevel"
|
|
|
|
script:
|
|
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
|
|
# https://gitlab.gnome.org/World/podcasts/issues/55
|
|
# Force regeneration of gresources regardless of artifacts chage
|
|
- flatpak-builder --run app ${MANIFEST_PATH} glib-compile-resources --sourcedir=podcasts-gtk/resources/ podcasts-gtk/resources/resources.xml
|
|
|
|
# Build the flatpak repo
|
|
- flatpak-builder --run app ${MANIFEST_PATH} meson --prefix=/app ${CONFIGURE_ARGS} _build
|
|
- flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build install
|
|
|
|
# Run the tests
|
|
- |
|
|
xvfb-run -a -s "-screen 0 1024x768x24" \
|
|
flatpak-builder --run \
|
|
--env=APP_ID="org.gnome.PodcastsDevel" \
|
|
--env=LOCALEDIR="./podcasts-gtk/po" \
|
|
--env=VERSION="0.0.0" \
|
|
--env=RUSTFLAGS="--cfg rayon_unstable" \
|
|
--env=CARGO_HOME="target/cargo-home" \
|
|
--env=CARGO_TARGET_DIR="target_test/" \
|
|
app ${MANIFEST_PATH} \
|
|
cargo test -j 1 -- --test-threads=1
|
|
|
|
# Create a flatpak bundle
|
|
- flatpak-builder --finish-only app ${MANIFEST_PATH}
|
|
- flatpak build-export repo app
|
|
- flatpak build-bundle repo ${BUNDLE} ${DBUS_ID}
|
|
|
|
artifacts:
|
|
paths:
|
|
- $BUNDLE
|
|
expire_in: 2 days
|
|
|
|
cache:
|
|
key: "flatpak"
|
|
paths:
|
|
- .flatpak-builder/downloads/
|
|
- .flatpak-builder/git/
|
|
- target/
|
|
- target_test/
|
|
|
|
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/podcasts
|
|
- tags
|
|
|
|
stop_review:
|
|
stage: review
|
|
script:
|
|
- echo "Stopping flatpak deployment"
|
|
when: manual
|
|
environment:
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
action: stop
|
|
except:
|
|
- master@World/podcasts
|
|
- tags
|
|
|
|
# Configure and run rustfmt on nightly
|
|
# Exits and builds fails if on bad format
|
|
rustfmt:
|
|
image: "registry.gitlab.com/alatiera/rustfmt-oci-image/rustfmt:nightly"
|
|
stage: lint
|
|
script:
|
|
- rustc -Vv && cargo -Vv
|
|
- cargo fmt --version
|
|
- cargo fmt --all -- --check |