Browse Source

ci: Test metainfo when it changes

Avoids bad surprises with Flathub after a release is tagged.
merge-requests/1461/merge
Kévin Commaille 2 years ago
parent
commit
ed3d85bc8e
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416
  1. 3
      .gitlab-ci.yml
  2. 8
      .gitlab-ci/build.yml
  3. 21
      .gitlab-ci/test.yml

3
.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"

8
.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:

21
.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
Loading…
Cancel
Save