---
name: Flake Finder

on:
  schedule:
    - cron: "0 0,1 * * *"

jobs:
  e2e:
    name: E2E
    timeout-minutes: 30
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        globalnet: ['', 'globalnet']
        deploytool: ['operator', 'helm']
    steps:
      - name: Check out the repository
        uses: actions/checkout@v2

      - name: Reclaim free space
        run: |
          sudo swapoff -a
          sudo rm -f /swapfile
          df -h
          free -h

      - name: Run E2E deployment and tests
        run: |
          make e2e using="${{ matrix.globalnet }} ${{ matrix.deploytool }}"

      - name: Post mortem
        if: failure()
        run: |
          df -h
          free -h
          make post-mortem
