diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce5337af..a7cc2df6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,9 @@ include: - local: .gitlab-ci/build.yml rules: - if: $CI_COMMIT_TAG == null + - local: .gitlab-ci/test.yml + rules: + - if: $CI_COMMIT_TAG == null - local: .gitlab-ci/publish_docs.yml rules: - if: $CI_COMMIT_BRANCH == "main" diff --git a/.gitlab-ci/build.yml b/.gitlab-ci/build.yml index 87efc633..efb734de 100644 --- a/.gitlab-ci/build.yml +++ b/.gitlab-ci/build.yml @@ -10,6 +10,14 @@ build@x86_64: extends: - .flatpak@x86_64 stage: build + artifacts: + paths: + - $BUNDLE + - 'repo.tar' + - '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/meson-log.txt' + - '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/testlog.txt' + # Add the metainfo file for the corresponding test. + - '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/data/${APP_ID}.metainfo.xml' build@aarch64: extends: diff --git a/.gitlab-ci/test.yml b/.gitlab-ci/test.yml new file mode 100644 index 00000000..89cd889c --- /dev/null +++ b/.gitlab-ci/test.yml @@ -0,0 +1,21 @@ +# Tests after the app is built. + +# Validate the metainfo with Flathub's tool. +metainfo: + stage: test + image: + name: "ghcr.io/flathub/flatpak-builder-lint:latest" + entrypoint: [""] + variables: + METAINFO: ".flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/data/${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"] + rules: + - changes: + - data/org.gnome.Fractal.metainfo.xml.in.in + when: always + - when: manual \ No newline at end of file