Skip to content

Commit

Permalink
ci(flatpak): use local exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Feb 21, 2025
1 parent 863294d commit a162817
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 62 deletions.
49 changes: 10 additions & 39 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,52 +227,23 @@ jobs:
- name: Lint Flatpak
working-directory: build
run: |
exceptions_file="${{ github.workspace }}/packaging/linux/flatpak/exceptions.json"
echo "Linting flatpak manifest"
flatpak run --command=flatpak-builder-lint org.flatpak.Builder \
manifest ${APP_ID}.yml > _flatpak-lint-exceptions_manifest.json || true
--exceptions \
--user-exceptions "${exceptions_file}" \
manifest \
${APP_ID}.yml
echo "Linting flatpak repo"
# TODO: add arg
# --mirror-screenshots-url=https://dl.flathub.org/media \
flatpak run --command=flatpak-builder-lint org.flatpak.Builder \
repo repo > _flatpak-lint-exceptions_repo.json || true
checks=(manifest repo)
exit_code=0
# check if files are equal
for check in "${checks[@]}"; do
echo "Validating $check"
# load baseline and result files
baseline="${{ github.workspace }}/packaging/linux/flatpak/flatpak-lint-baseline_${check}.json"
result="_flatpak-lint-exceptions_${check}.json"
# Extract errors from both JSON files
readarray -t result_errors < <(jq -r '.errors[]' "$result")
readarray -t baseline_errors < <(jq -r '.errors[]' "$baseline")
# Loop through result errors and check against baseline errors
for error in "${result_errors[@]}"; do
if printf '%s\n' "${baseline_errors[@]}" | grep -q -F "$error"; then
echo "::warning:: '$error'"
else
echo "::error:: '$error'"
exit_code=1
fi
done
done
# if exit code is not 0, print results
if [ $exit_code -ne 0 ]; then
echo "Manifest lint results:"
cat _flatpak-lint-exceptions_manifest.json
echo "Repo lint results:"
cat _flatpak-lint-exceptions_repo.json
fi
# exit with the correct code
exit $exit_code
--exceptions \
--user-exceptions "${exceptions_file}" \
repo \
repo
- name: Package Flathub repo archive
# copy files required to generate the Flathub repo
Expand Down
8 changes: 8 additions & 0 deletions packaging/linux/flatpak/exceptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dev.lizardbyte.app.Sunshine": [
"appstream-missing-screenshots",
"appstream-screenshots-not-mirrored-in-ostree",
"external-gitmodule-url-found",
"finish-args-flatpak-spawn-access"
]
}
11 changes: 0 additions & 11 deletions packaging/linux/flatpak/flatpak-lint-baseline_manifest.json

This file was deleted.

12 changes: 0 additions & 12 deletions packaging/linux/flatpak/flatpak-lint-baseline_repo.json

This file was deleted.

0 comments on commit a162817

Please sign in to comment.