name: Integration tests

on:
  push:
    branches: ['main']
  pull_request:
    branches: ['main']

permissions:
  contents: read

jobs:
  tests:
    runs-on: ubuntu-latest
    env:
      IMAGE_REPO: 'localhost:5000'
      REGISTRY: 'localhost:5000'
    strategy:
      fail-fast: false
      matrix:
        make-target:
        - integration-test-layers
        - integration-test-misc
        - integration-test-run
        - k8s-executor-build-push integration-test-k8s

    steps:
    - uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3
      with:
        go-version: 1.17
    - uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3
    - uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1

    - run: make install-container-diff minikube-setup
    - run: make ${{ matrix.make-target }}
