name: "Check sdist"
permissions:
  contents: read

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  check-sdist:
    # Don't run on forks
    if: github.repository == 'jax-sklearn/jax-sklearn'

    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.10'
      - name: Install dependencies
        # scipy and cython are required to build sdist
        run: |
          python -m pip install --upgrade pip
          pip install check-sdist
      - run: |
          check-sdist --inject-junk

  update-tracker:
    uses: ./.github/workflows/update_tracking_issue.yml
    if: ${{ always() }}
    needs: [check-sdist]
    with:
      job_status: ${{ needs.check-sdist.result }}
    secrets:
      BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
