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:
|
||||
- lint
|
||||
- test
|
||||
- review
|
||||
|
||||
variables:
|
||||
BUNDLE: "org.gnome.Podcasts.Devel.flatpak"
|
||||
include:
|
||||
- project: 'gnome/citemplates'
|
||||
file: 'flatpak/flatpak-ci-initiative-sdk-extensions.yml'
|
||||
# ref: ''
|
||||
|
||||
flatpak:
|
||||
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
|
||||
stage: "test"
|
||||
variables:
|
||||
MANIFEST_PATH: "org.gnome.Podcasts.Devel.json"
|
||||
FLATPAK_MODULE: "gnome-podcasts"
|
||||
CONFIGURE_ARGS: "-Dprofile=development"
|
||||
DBUS_ID: "org.gnome.Podcasts.Devel"
|
||||
|
||||
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
|
||||
variables:
|
||||
MANIFEST_PATH: "org.gnome.Podcasts.Devel.json"
|
||||
FLATPAK_MODULE: "gnome-podcasts"
|
||||
MESON_ARGS: "-Dprofile=development"
|
||||
APP_ID: "org.gnome.Podcasts.Devel"
|
||||
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||
BUNDLE: "org.gnome.Podcasts.Devel.flatpak"
|
||||
.extends: '.flatpak'
|
||||
|
||||
# Configure and run rustfmt
|
||||
# Exits and builds fails if on bad format
|
||||
rustfmt:
|
||||
image: "rust:slim"
|
||||
stage: "lint"
|
||||
stage: ".pre"
|
||||
script:
|
||||
- rustup component add rustfmt
|
||||
# Create blank versions of our configured files
|
||||
|
||||
Loading…
Reference in New Issue
Block a user