-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add some basic manifest validation in CI
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
CI: | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up dependencies | ||
run: | | ||
sudo add-apt-repository ppa:flatpak/stable | ||
sudo apt-get update | ||
sudo apt-get install -y flatpak | ||
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | ||
flatpak install flathub -y org.flatpak.Builder | ||
- name: Validate manifests | ||
run: | | ||
set -e | ||
for i in $(find . -type f -name "*.json"); do flatpak run org.flatpak.Builder --show-manifest --show-manifest "$i"; done | ||
rm -rf .flatpak-builder | ||
find . -maxdepth 1 -mindepth 1 -type d ! -path './.github' ! -path './.git' | while read dir; do | ||
if [ "$(find "$dir" -maxdepth 1 -type f -name '*.json' | wc -l)" -eq 0 ]; then | ||
echo "Error: $dir has no JSON manifest" | ||
exit 1 | ||
fi | ||
done | ||
files="$(find . -type f \( -name '*.yml' -o -name '*.yaml' \) ! -path './.github/*' ! -path './.git')" | ||
if [ -n "$files" ]; then | ||
echo "Error: YML/YAML file found: $files" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.flatpak-builder/ |