name: e2e

on:
  workflow_dispatch:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

permissions:
  contents: read # for actions/checkout to fetch code

jobs:
  kind:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        provider:
          # service mesh
          - istio
          - linkerd
          - osm
          - kuma
          # ingress controllers
          - contour
          - nginx
          - traefik
          - gloo
          - skipper
          - kubernetes
          - gatewayapi
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Kubernetes
        uses: engineerd/setup-kind@v0.5.0
        with:
          version: "v0.14.0"
          image: kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae
      - name: Build container image
        run: |
          docker build -t test/flagger:latest .
          kind load docker-image test/flagger:latest
      - name: Run tests
        run: |
          ./test/${{ matrix['provider'] }}/run.sh
