# Tests after the app is built. include: '.gitlab-ci/utils.yml' # Validate the metainfo with Flathub's tool. lint-metainfo: stage: test image: name: "ghcr.io/flathub/flatpak-builder-lint:latest" entrypoint: [""] variables: METAINFO: "${APP_ID}.metainfo.xml" interruptible: true script: # This tool has extra tests on top of appstreamcli and is required to pass for Flathub. - flatpak-builder-lint appstream ${METAINFO} # Test also with the pedantic and strict flags. - appstreamcli validate --pedantic --explain --strict ${METAINFO} needs: ["build@x86_64"] # Run the Rust tests. rust-tests: stage: test image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master' tags: - flatpak interruptible: true script: # Create a temporary file. - TMP_FILE=$(mktemp) # Add a module for nextest to the Flatpak manifest and write it to the temporary file. - jq --slurpfile nextest .gitlab-ci/nextest.module.json '.modules = [$nextest[], .modules[]]' ${MANIFEST_PATH} > ${TMP_FILE} # Replace the manifest with the temporary file. - mv $TMP_FILE ${MANIFEST_PATH} # Initialize the Flatpak sandbox. - flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH} # Run the tests. - echo "meson compile src/cargo-test" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} dependencies: [] artifacts: reports: junit: '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/src/junit.xml' # Test that there are no errors in the docs. build-docs: extends: - .remove_build_only_modules stage: test image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master' tags: - flatpak interruptible: true variables: FREEDESKTOP_RUNTIME_BRANCH: "25.08" script: - flatpak install --user --noninteractive org.freedesktop.Sdk.Extension.rust-nightly//${FREEDESKTOP_RUNTIME_BRANCH} # We want to use the nightly toolchain inside the build terminal. - sed -i 's|"org.freedesktop.Sdk.Extension.rust-stable"|"org.freedesktop.Sdk.Extension.rust-nightly"|g' ${MANIFEST_PATH} - sed -i 's|/rust-stable/bin|/rust-nightly/extra/sdk/rust-nightly/bin|g' ${MANIFEST_PATH} # Do not use the mold linker because it doesn't work with the rust-nightly extension at the moment - sed -i 's|-C link-arg=-fuse-ld=mold||g' ${MANIFEST_PATH} - flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH} - echo "meson compile src/cargo-doc" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} - tar --auto-compress --create --file "${CI_PROJECT_DIR}/${CI_PROJECT_NAME}-docs.tar.gz" --directory ".flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/src/doc" . dependencies: [] artifacts: paths: - ${CI_PROJECT_NAME}-docs.tar.gz