---
name: End to End Tests

on:
  pull_request:

jobs:
  e2e:
    name: E2E
    timeout-minutes: 45
    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: |
          # cleanup 30GB+ of tools we don't need for our CI
          rm -rf /opt/ghc /usr/share/dotnet /usr/share/swift
          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
