You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

63 lines
2.8 KiB

# 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"
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:
extends:
- .remove_build_only_modules
stage: test
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
tags:
- flatpak
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 "cargo-nextest nextest run --config-file ../.gitlab-ci/nextest.toml" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
dependencies: []
artifacts:
reports:
junit: '.flatpak-builder/build/${FLATPAK_MODULE}/target/nextest/default/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
script:
- flatpak install --user --noninteractive org.freedesktop.Sdk.Extension.rust-nightly//24.08
# 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}
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
- echo "ninja src/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