name: Catalog consistency checks

on:
  pull_request:
  push:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Set up Python 3.11
      uses: actions/setup-python@v4
      with:
        python-version: 3.11
    - name: Install toml python lib
      run: |
        pip3 install toml jsonschema
    - name: Check TOML validity for apps.toml
      run: |
        python3 -c "import toml; toml.load(open('apps.toml'))"
    - name: Check all working apps have consistent app id / app url and categories
      run: |
        python3 tools/catalog_linter.py
