---
name: End to End Tests

on:
  pull_request:

jobs:
  e2e:
    name: E2E
    timeout-minutes: 45
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        deploytool: ['operator']
        globalnet: ['', 'globalnet']
        cable_driver: ['libreswan', 'wireguard']
        ovn: ['', 'ovn']
        k8s_version: ['1.20.2']
        exclude:
          - ovn: 'ovn'
            globalnet: 'globalnet'
          - ovn: 'ovn'
            cable_driver: 'wireguard'
        include:
          # This is the oldest K8s version we try to support
          - k8s_version: 1.17.17
    steps:
      - name: Check out the repository
        uses: actions/checkout@v2

      - name: Run E2E deployment and tests
        uses: submariner-io/shipyard/gh-actions/e2e@release-0.9
        with:
          k8s_version: ${{ matrix.k8s_version }}
          using: ${{ matrix.cable_driver }} ${{ matrix.deploytool }} ${{ matrix.globalnet }} ${{ matrix.ovn }}

      - name: Post mortem
        if: failure()
        uses: submariner-io/shipyard/gh-actions/post-mortem@release-0.9
