Skip to content

Commit

Permalink
CI: WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgesStavracas committed Feb 23, 2024
1 parent ba4f17e commit c4b79c6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/actions/flatpak-builder-lint/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run flatpak-builder-lint
description: Runs flatpak-builder-lint with exceptions
inputs:
artifact:
description: Type of artifact to lint (builddir, repo, manifest)
description: Type of artifact to lint (builddir, repo, manifest, appstream)
required: true
path:
description: Path to flatpak-builder manifest or Flatpak build directory
Expand All @@ -23,6 +23,7 @@ runs:
builddir);;
repo);;
manifest);;
appstream);;
*)
echo "::error::Given artifact type is incorrect"
exit 2
Expand All @@ -36,12 +37,17 @@ runs:
run: |
: Run flatpak-builder-lint
exit_code=0
ret=$(flatpak-builder-lint --exceptions ${{ inputs.artifact }} ${{ inputs.path }}) || exit_code=$?
if [[ $exit_code != 0 && -z "$ret" ]]; then
echo "::error::Error while running flatpak-builder-lint"
exit 2
fi
if [[ "${{ inputs.artifact }}" == "appstream" ]]; then
exit 0
fi
for ((i = 0 ; i < $(echo $ret | jq '.warnings | length') ; i++)); do
warning=$(echo $ret | jq ".warnings[$i]")
echo "::warning::$warning found in the Flatpak ${{ inputs.artifact }}"
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,19 @@ jobs:
cache-key: ${{ steps.setup.outputs.cacheKey }}
mirror-screenshots-url: https://dl.flathub.org/media

- name: Validate AppStream
uses: ./.github/actions/flatpak-builder-lint
with:
artifact: appstream
path: flatpak_app/files/share/metainfo/com.obsproject.Studio.metainfo.xml

- name: Verify Icon and Metadata in app-info
working-directory: ${{ env.FLATPAK_BUILD_PATH }}
run: |
: Verify Icon and Metadata in app-info
test -f app-info/icons/flatpak/128x128/com.obsproject.Studio.png || { echo "Missing 128x128 icon in app-info!"; exit 1; }
test -f app-info/xmls/com.obsproject.Studio.xml.gz || { echo "Missing com.obsproject.Studio.xml.gz in app-info!"; exit 1; }
- name: Validate build directory
uses: ./.github/actions/flatpak-builder-lint
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
working-directory: ${{ env.FLATPAK_BUILD_PATH }}
run: |
: Validate AppStream
appstream-util validate appdata/com.obsproject.Studio.appdata.xml
appstream-util validate metainfo/com.obsproject.Studio.metainfo.xml
- name: Verify Icon and Metadata in app-info
working-directory: ${{ env.FLATPAK_BUILD_PATH }}
Expand Down

0 comments on commit c4b79c6

Please sign in to comment.