mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 08:44:40 +01:00
simplify the ci
This commit is contained in:
parent
338fd0fd37
commit
f2748e36d9
1 changed files with 11 additions and 78 deletions
|
@ -1,90 +1,23 @@
|
|||
stages:
|
||||
- lint
|
||||
- test
|
||||
- review
|
||||
|
||||
variables:
|
||||
BUNDLE: "authenticator-nightly.flatpak"
|
||||
include:
|
||||
- project: 'gnome/citemplates'
|
||||
file: 'flatpak/flatpak_ci_initiative.yml'
|
||||
|
||||
flatpak:
|
||||
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
|
||||
stage: "test"
|
||||
variables:
|
||||
MANIFEST_PATH: "build-aux/com.bilelmoussaoui.AuthenticatorDevel.json"
|
||||
FLATPAK_MODULE: "authenticator"
|
||||
MESON_ARGS: "-Dprofile=development"
|
||||
APP_ID: "com.bilelmoussaoui.AuthenticatorDevel"
|
||||
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master'
|
||||
variables:
|
||||
BUNDLE: "authenticator-nightly.flatpak"
|
||||
MANIFEST_PATH: "build-aux/com.belmoussaoui.Authenticator.Devel.json"
|
||||
FLATPAK_MODULE: "authenticator"
|
||||
APP_ID: "com.belmoussaoui.Authenticator.Devel"
|
||||
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||
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 ${MESON_ARGS} _build
|
||||
- flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build install
|
||||
# Run tests
|
||||
- >
|
||||
xvfb-run -a -s "-screen 0 1024x768x24"
|
||||
flatpak build
|
||||
--env=LANG=C.UTF-8
|
||||
--env=NO_AT_BRIDGE=1
|
||||
app
|
||||
dbus-run-session
|
||||
meson test -C _build --no-stdsplit --print-errorlogs
|
||||
|
||||
# Create a flatpak bundle
|
||||
- flatpak-builder --finish-only app ${MANIFEST_PATH}
|
||||
- flatpak build-export repo app
|
||||
- flatpak build-bundle repo ${BUNDLE} ${APP_ID}
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- $BUNDLE
|
||||
expire_in: 5 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
|
||||
|
||||
stop_review:
|
||||
stage: review
|
||||
script:
|
||||
- echo "Stopping flatpak deployment"
|
||||
when: manual
|
||||
environment:
|
||||
name: review/$CI_COMMIT_REF_NAME
|
||||
action: stop
|
||||
|
||||
# Configure and run rustfmt
|
||||
# Exits and builds fails if on bad format
|
||||
rustfmt:
|
||||
image: "rust:slim"
|
||||
stage: "lint"
|
||||
script:
|
||||
- rustup component add rustfmt
|
||||
# Create blank versions of our configured files
|
||||
# so rustfmt does not yell about non-existent files or completely empty files
|
||||
- echo -e "" >> src/config.rs
|
||||
- echo -e "" >> src/static_resources.rs
|
||||
- rustc -Vv && cargo -Vv
|
||||
- cargo fmt --version
|
||||
- cargo fmt --all -- --color=always --check
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue