Feat: Downstream pull-secret-propagation xKS #359
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build, Deploy and Test on KinD | |
| on: | |
| pull_request: | |
| branches: | |
| - "master" | |
| - "v*" | |
| push: | |
| branches: | |
| - "master" | |
| - "v*" | |
| permissions: | |
| contents: read | |
| env: | |
| IMG: gitops-operator:test | |
| LOG_DIR: /tmp/kind-ci-artifacts | |
| jobs: | |
| ci-build: | |
| name: Build image, deploy to kind cluster | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Prepare log directory | |
| run: mkdir -p "${{ env.LOG_DIR }}" | |
| - name: Create kind cluster | |
| uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1 | |
| with: | |
| cluster_name: gitops-test | |
| config: test/kind-config.yaml | |
| # TODO: check if porting is required for non-OCP clusters | |
| - name: Disable webhook and conversion for non-OCP cluster | |
| run: | | |
| sed -i 's|^- ../prometheus|#- ../prometheus|' config/default/kustomization.yaml | |
| sed -i 's|^- ../webhook|#- ../webhook|' config/default/kustomization.yaml | |
| sed -i 's|^- patches/webhook_in_argocds.yaml|#- patches/webhook_in_argocds.yaml|' config/crd/kustomization.yaml | |
| sed -i 's|^- patches/cainjection_in_argocds.yaml|#- patches/cainjection_in_argocds.yaml|' config/crd/kustomization.yaml | |
| echo "=== Verify sed applied ===" | |
| grep -n 'webhook\|prometheus' config/default/kustomization.yaml | |
| grep -n 'patches/' config/crd/kustomization.yaml | |
| - name: Build manager image | |
| run: | | |
| set -o pipefail | |
| make docker-build IMG=${{ env.IMG }} 2>&1 | tee "${{ env.LOG_DIR }}/docker-build.log" | |
| - 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: | | |
| set -o pipefail | |
| make deploy IMG=${{ env.IMG }} 2>&1 | tee "${{ env.LOG_DIR }}/deploy.log" | |
| - name: Verify Controller Manager deployment is available | |
| run: | | |
| set -o pipefail | |
| { | |
| kubectl get deployment -n openshift-gitops-operator | |
| kubectl describe deployment -n openshift-gitops-operator | |
| kubectl wait --for=condition=available --timeout=300s \ | |
| deployment/openshift-gitops-operator-controller-manager \ | |
| -n openshift-gitops-operator | |
| } 2>&1 | tee "${{ env.LOG_DIR }}/verify-deployment.log" | |
| - name: Run E2E tests Sequential on xKS | |
| run: | | |
| set -o pipefail | |
| NON_OLM=true make e2e-xks-tests-sequential-ginkgo 2>&1 | tee "${{ env.LOG_DIR }}/e2e-sequential.log" | |
| - name: Run E2E tests Parallel on xKS | |
| run: | | |
| set -o pipefail | |
| NON_OLM=true make e2e-xks-tests-parallel-ginkgo 2>&1 | tee "${{ env.LOG_DIR }}/e2e-parallel.log" | |
| - name: Upload CI artifacts | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: kind-ci-artifacts-${{ github.run_id }} | |
| path: ${{ env.LOG_DIR }}/ | |
| if-no-files-found: ignore | |
| retention-days: 7 | |