name: Add-on Validations

on:
  push:
    branches: [ master, main ]

  pull_request:
    branches: [ master, main ]

jobs:
  addon-validations:
    if: github.repository == 'anxdpanic/plugin.video.youtube'

    name: Add-on Validations
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        python-version: [ '3.12' ]

    steps:
      - name: Checkout Add-on
        uses: actions/checkout@v4
        with:
          path: ${{ github.event.repository.name }}

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install git+https://github.com/xbmc/addon-check.git

      - name: Kodi Add-on Checker (Nexus)
        id: kodi-addon-checker-nexus
        run: |
          kodi-addon-checker ${{ github.event.repository.name }} --branch=nexus
