test: fixing e2e test #546
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: Go | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: {} | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| # Common versions | |
| GO_VERSION: '1.23' | |
| GOLANGCI_VERSION: 'v1.56' | |
| KIND_VERSION: 'v0.29.0' | |
| K8S_VERSION: 'v1.31.9' | |
| jobs: | |
| detect-noop: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| noop: ${{ steps.noop.outputs.should_skip }} | |
| steps: | |
| - name: Detect No-op Changes | |
| id: noop | |
| uses: fkirc/skip-duplicate-actions@v3.3.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]' | |
| do_not_skip: '["workflow_dispatch", "schedule", "push"]' | |
| concurrent_skipping: false | |
| test: | |
| runs-on: ubuntu-22.04 | |
| needs: detect-noop | |
| if: needs.detect-noop.outputs.noop != 'true' | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| id: go | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache Go Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .work/pkg | |
| key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} | |
| restore-keys: ${{ runner.os }}-pkg- | |
| - name: install Kubebuilder | |
| run: | | |
| # Install setup-envtest for managing test binaries | |
| go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | |
| # Setup the test environment with the correct Kubernetes version | |
| export KUBEBUILDER_ASSETS=$(setup-envtest use 1.31.x --print path --bin-dir ~/.local/bin) | |
| echo "KUBEBUILDER_ASSETS=$KUBEBUILDER_ASSETS" >> $GITHUB_ENV | |
| # Verify the setup | |
| ls -la $KUBEBUILDER_ASSETS | |
| - name: Run Make test | |
| run: make test | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: cover.out | |
| flags: unit-test | |
| name: codecov-umbrella | |
| fail_ci_if_error: true | |
| verbose: true | |
| - name: Run Make | |
| run: make | |
| e2e-cluster-gateway: | |
| runs-on: ubuntu-22.04 | |
| needs: detect-noop | |
| if: needs.detect-noop.outputs.noop != 'true' | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| id: go | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache Go Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .work/pkg | |
| key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} | |
| restore-keys: ${{ runner.os }}-pkg- | |
| - name: Create k8s Kind Cluster | |
| uses: helm/kind-action@v1.2.0 | |
| with: | |
| version: ${{ env.KIND_VERSION }} | |
| node_image: kindest/node:${{ env.K8S_VERSION }} | |
| - name: Build Image | |
| run: | | |
| make image | |
| kind load docker-image oamdev/cluster-gateway:latest --name chart-testing | |
| - name: Prepare ClusterGateway E2E Environment | |
| run: | | |
| helm install --create-namespace -n vela-system \ | |
| cluster-gateway ./charts/cluster-gateway \ | |
| --set featureGate.healthiness=true \ | |
| --set featureGate.secretCache=true \ | |
| --set tag=latest | |
| kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev | |
| go run ./e2e/env/prepare | kubectl apply -f - | |
| - name: Run Make test | |
| run: | | |
| kubectl get clustergateway | |
| make test-e2e | |
| e2e-ocm-addon-cluster-gateway: | |
| runs-on: ubuntu-22.04 | |
| needs: detect-noop | |
| if: needs.detect-noop.outputs.noop != 'true' | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| id: go | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache Go Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .work/pkg | |
| key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} | |
| restore-keys: ${{ runner.os }}-pkg- | |
| - name: Install clusteradm | |
| run: curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/main/install.sh | bash | |
| - name: Create k8s Kind Cluster | |
| uses: helm/kind-action@v1.2.0 | |
| with: | |
| version: ${{ env.KIND_VERSION }} | |
| node_image: kindest/node:${{ env.K8S_VERSION }} | |
| - name: Prepare OCM testing environment | |
| run: | | |
| clusteradm init --output-join-command-file join.sh --wait | |
| sh -c "$(cat join.sh) loopback --force-internal-endpoint-lookup" | |
| clusteradm accept --clusters loopback --wait 30 | |
| kubectl wait --for=condition=ManagedClusterConditionAvailable managedcluster/loopback | |
| - name: Build image | |
| run: | | |
| make image | |
| kind load docker-image oamdev/cluster-gateway:latest --name chart-testing | |
| kind load docker-image oamdev/cluster-gateway-addon-manager:latest --name chart-testing | |
| - name: Install latest cluster-gateway | |
| run: | | |
| helm install --create-namespace -n open-cluster-management-addon \ | |
| cluster-gateway ./charts/addon-manager \ | |
| --set tag=latest | |
| go run ./e2e/env/prepare | kubectl apply -f - | |
| kubectl rollout status deployment -n vela-system gateway-deployment --timeout 1m | |
| kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev | |
| - name: Run e2e test | |
| run: | | |
| sleep 120 | |
| make test-e2e-ocm |