podcasts/.gitlab-ci.yml
Jordan Petridis 5a0413b3e4
CI: Remove --libdir=/app/libdir from meson config
This is not needed anymore I think.
2018-08-16 08:30:29 +03:00

89 lines
2.5 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 _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=CARGO_HOME="target/cargo-home/" \
--env=RUSTFLAGS="--cfg rayon_unstable" \
app org.gnome.Podcasts.json \
cargo test -- --test-threads=1
- ls -alR
- tree -d
# - 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
- 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