name: scheduled-tests

on:
  schedule:
    - cron: "*/30 * * * *"

jobs:
  download:
    runs-on: ubuntu-latest

    steps:
      - name: Set up python
        uses: actions/setup-python@v2
        with:
          python-version: 3.6

      - name: Upgrade pip
        run: python -m pip install --upgrade pip

      - name: Install PyTorch for CPU from the nightlies
        run: |
          pip install numpy
          pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html

      - name: Install test requirements
        run: pip install pytest pytest-subtests

      - name: Simulate failing tests
        run: exit 1

      - name: Create issue for failed workflow
        if: failure()
        run: echo "Create an issue referencing this workflow run"
