78 lines
2.3 KiB
YAML
78 lines
2.3 KiB
YAML
stages:
|
|
- test
|
|
- lint
|
|
- review
|
|
|
|
variables:
|
|
BUNDLE: "gnome-podcasts-dev.flatpak"
|
|
|
|
flatpak:
|
|
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:3.28
|
|
stage: test
|
|
script:
|
|
- flatpak-builder --stop-at=gnome-podcasts app org.gnome.Podcasts.json
|
|
# https://gitlab.gnome.org/World/podcasts/issues/55
|
|
# Force regeneration of gresources regardless of artifacts chage
|
|
- flatpak-builder --run app org.gnome.Podcasts.json glib-compile-resources --sourcedir=podcasts-gtk/resources/ podcasts-gtk/resources/resources.xml
|
|
|
|
# Build the flatpak repo
|
|
- flatpak-builder --run app org.gnome.Podcasts.json meson --prefix=/app --libdir=/app/lib _build
|
|
- flatpak-builder --run app org.gnome.Podcasts.json ninja -C _build install
|
|
- flatpak-builder --finish-only app org.gnome.Podcasts.json
|
|
- flatpak build-export repo app
|
|
|
|
# Run the tests
|
|
- flatpak-builder --run --env=RUSTFLAGS="--cfg rayon_unstable" app org.gnome.Podcasts.json cargo test -- --test-threads=1
|
|
# - flatpak-builder --run app org.gnome.Podcasts.json cargo test -- --test-threads=1 --ignored
|
|
# Create a flatpak bundle
|
|
- flatpak build-bundle repo ${BUNDLE} org.gnome.Podcasts
|
|
|
|
artifacts:
|
|
paths:
|
|
- $BUNDLE
|
|
expire_in: 2 days
|
|
|
|
cache:
|
|
key: "flatpak"
|
|
paths:
|
|
- .flatpak-builder/cache/
|
|
- target/
|
|
|
|
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
|
|
|
|
stop_review:
|
|
stage: review
|
|
script:
|
|
- echo "Stopping flatpak deployment"
|
|
when: manual
|
|
environment:
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
action: stop
|
|
except:
|
|
- master@World/podcasts
|
|
|
|
# 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
|