name: Link checks

on:
  # Run manually by clicking a button in the UI
  workflow_dispatch:
  # Run once a day at 8:00am UTC
  schedule:
    - cron: '0 8 * * *'

env:
  COMPILER: gcc
  OS_NAME: 'linux'
  TASK: 'check-links'

jobs:
  check-links:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5
        with:
          fetch-depth: 5
          submodules: false
      - name: Setup and run tests
        run: |
          export CONDA=${HOME}/miniforge
          export PATH=${CONDA}/bin:${HOME}/.local/bin:${PATH}
          $GITHUB_WORKSPACE/.ci/setup.sh || exit 1
          $GITHUB_WORKSPACE/.ci/test-docs.sh || exit 1
