CI: Refactor to use the citemplate
https://gitlab.gnome.org/GNOME/Initiatives/wikis/DevOps-with-Flatpak
This commit is contained in:
parent
bcd610e2e3
commit
a9ba3fcbab
@ -1,89 +1,23 @@
|
|||||||
stages:
|
include:
|
||||||
- lint
|
- project: 'gnome/citemplates'
|
||||||
- test
|
file: 'flatpak/flatpak-ci-initiative-sdk-extensions.yml'
|
||||||
- review
|
# ref: ''
|
||||||
|
|
||||||
variables:
|
|
||||||
BUNDLE: "org.gnome.Podcasts.Devel.flatpak"
|
|
||||||
|
|
||||||
flatpak:
|
flatpak:
|
||||||
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
|
variables:
|
||||||
stage: "test"
|
MANIFEST_PATH: "org.gnome.Podcasts.Devel.json"
|
||||||
variables:
|
FLATPAK_MODULE: "gnome-podcasts"
|
||||||
MANIFEST_PATH: "org.gnome.Podcasts.Devel.json"
|
MESON_ARGS: "-Dprofile=development"
|
||||||
FLATPAK_MODULE: "gnome-podcasts"
|
APP_ID: "org.gnome.Podcasts.Devel"
|
||||||
CONFIGURE_ARGS: "-Dprofile=development"
|
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||||
DBUS_ID: "org.gnome.Podcasts.Devel"
|
BUNDLE: "org.gnome.Podcasts.Devel.flatpak"
|
||||||
|
.extends: '.flatpak'
|
||||||
script:
|
|
||||||
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
|
|
||||||
|
|
||||||
# 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=CARGO_HOME="${CI_PROJECT_DIR}/target/cargo-home" \
|
|
||||||
--env=CARGO_TARGET_DIR="${CI_PROJECT_DIR}/target/" \
|
|
||||||
app ${MANIFEST_PATH} \
|
|
||||||
ninja -C _build test
|
|
||||||
|
|
||||||
# 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
|
# Configure and run rustfmt
|
||||||
# Exits and builds fails if on bad format
|
# Exits and builds fails if on bad format
|
||||||
rustfmt:
|
rustfmt:
|
||||||
image: "rust:slim"
|
image: "rust:slim"
|
||||||
stage: "lint"
|
stage: ".pre"
|
||||||
script:
|
script:
|
||||||
- rustup component add rustfmt
|
- rustup component add rustfmt
|
||||||
# Create blank versions of our configured files
|
# Create blank versions of our configured files
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user