diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml new file mode 100644 index 00000000000..39d2866d491 --- /dev/null +++ b/.github/workflows/deploy-test.yaml @@ -0,0 +1,50 @@ +name: Build, Deploy and Test on kind + +on: + pull_request: + branches: + - '*' + +env: + IMG: gitops-operator:test + +jobs: + deploy-test: + name: Build image, deploy to kind cluster and run tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Create kind cluster + uses: helm/kind-action@v1 + with: + cluster_name: gitops-test + + - name: Build manager image + run: | + docker build -t ${{ env.IMG }} . + + - name: Load image into kind + run: | + kind load docker-image ${{ env.IMG }} --name gitops-test + + - name: Install CRDs + run: | + make install + + - name: Deploy operator + run: | + make deploy IMG=${{ env.IMG }} + + - name: Verify Controller Manager deployment is available + run: | + kubectl wait --for=condition=available --timeout=120s \ + deployment/openshift-gitops-operator-controller-manager \ + -n openshift-gitops-operator + kubectl get pods -n openshift-gitops-operator