diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d7d202..4e88c49 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 - -