name: E2E

on:
  push:
    branches: [ master ]
  pull_request:
    types: [assigned, opened, synchronize, reopened]
    
jobs:

  E2E:
    runs-on: ubuntu-latest
    steps:

    - name: Check out code
      uses: actions/checkout@v3
      with:
        ref: ${{ github.event.workflow_run.head_sha }}
        submodules: 'recursive'      

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v2

    - name: Kind Warmup
      run: kind create cluster -n sshpipertest
      
    - name: E2E
      run: docker-compose up --build --abort-on-container-exit --exit-code-from testrunner
      working-directory: e2e
      env:
        COMPOSE_DOCKER_CLI_BUILD: "1"
        DOCKER_BUILDKIT: "1"


