name: Test Suite
on:
  workflow_dispatch:
  schedule:
    - cron: '00 15 * * *'

jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

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

      - name: Run tests
        run: |
          export KODI_INTERACTIVE=0
          ./tests/run.sh

      - name: Commit & Push changes
        uses: dmnemec/copy_file_to_another_repo_action@v1.0.4
        env:
          API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
        with:
          source_file: 'reports'
          destination_repo: 'kodiondemand/kodiondemand.github.io'
          user_email: 'tests@kod.bot'
          user_name: 'bot'
          commit_message: 'Test suite'