Get rid of check_id_unicity ... implement the check url<->appid consistency check using jq, the manifest id check is already handled by the linter

This commit is contained in:
Alexandre Aubin
2023-01-03 19:23:33 +01:00
parent 8e8b9a1594
commit 998273f926
2 changed files with 16 additions and 59 deletions

View File

@ -9,10 +9,21 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check apps.json
run: |
python -m json.tool apps.json
jq apps.json
- name: Check all working apps have consistent app id / app url
run: |
for LINE in $(cat apps.json | jq -r 'to_entries[] | select ( .value.state=="working" ) | "\(.key)|\(.value.url)"')
do
APP=$(echo $LINE | awk -F'|' '{print $1}')
URL_END=$(echo $LINE | awk -F'/' '{print $NF}')
[ "$APP" == "$(echo $APP | tr [A-Z] [a-z])" ] || echo "$APP : app id should be lowercase" >&2
[ "$URL_END" == "${APP}_ynh" ] || echo "$APP : the url should end with ${APP}_ynh" >&2
done
- name: Check all working apps have a category
run: |
jq -e -r '.[] | select ( .state=="working" ) | select ( has("category") | not )' apps.json
[ $? -eq 4 ] || echo "Some working applications don't have their category defined ?" >&2