name: Endurance Test
on:
  push:
    branches: [ master ]
    tags:
      - v*
  schedule:
    # run every 2 hours
    - cron:  '12 */2 * * *'
jobs:
  endurance-test:
    env:
      KOPIA_KEEP_LOGS: true
    name: Endurance Test
    runs-on: ubuntu-latest
    steps:
    - name: Set up Go.
      uses: actions/setup-go@v2
      with:
        go-version: ^1.16
      id: go
    - name: Check out code into the Go module directory
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: Endurance Tests
      run: make endurance-tests
    - name: Upload Logs
      uses: actions/upload-artifact@v2
      with:
        name: logs
        path: .logs/**/*.log
        if-no-files-found: ignore
      if: ${{ always() }}