name: Downstream Project - SPL (Nightly)

on:
  schedule:
    - cron: "0 3 * * *"

jobs:
  main:
    # As this is a cron job, it is better to avoid running it for all the forks.
    # They are unlike to benefit from these executions, and they could easily
    # eat up all the minutes GitHub allocation to free accounts.
    if: >
      github.event_name != 'schedule'
      || github.repository == 'solana-labs/solana'

    strategy:
      fail-fast: false
      matrix:
        branch:
          - master
    uses: ./.github/workflows/downstream-project-spl.yml
    with:
      branch: ${{ matrix.branch }}

  error_reporting:
    needs:
      - main
    if: failure()
    uses: ./.github/workflows/error-reporting.yml
    secrets:
      WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}