fix package issues and typo fixes #12
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: Integration Test Client Package | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'packages/client/**' | |
| - 'packages/ops/**' | |
| - 'packages/manifests/**' | |
| - '.github/workflows/test-client.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'packages/client/**' | |
| - 'packages/ops/**' | |
| - 'packages/manifests/**' | |
| - '.github/workflows/test-client.yml' | |
| workflow_dispatch: | |
| inputs: | |
| kubeconfig: | |
| description: 'Custom kubeconfig (leave empty to use Kind cluster)' | |
| required: false | |
| default: '' | |
| cli-version: | |
| description: 'CLI version to test (0.0.0 for local testing)' | |
| required: false | |
| default: '0.0.0' | |
| jobs: | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup kubectl | |
| uses: azure/setup-kubectl@v3 | |
| with: | |
| version: v1.31.3 | |
| - name: Setup Kind cluster | |
| if: ${{ inputs.kubeconfig == '' }} | |
| uses: helm/[email protected] | |
| with: | |
| cluster_name: kind | |
| kubectl_version: v1.31.3 | |
| wait: 300s | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.12.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages (excluding ops dashboard) | |
| run: pnpm --filter='!@kubernetesjs/ops-dashboard' build | |
| - name: Verify cluster connection | |
| run: | | |
| kubectl cluster-info | |
| kubectl get nodes | |
| kubectl get namespaces | |
| - name: Start kubectl proxy | |
| run: | | |
| kubectl proxy --port=8001 --accept-hosts='^.*$' --address='0.0.0.0' & | |
| echo "PROXY_PID=$!" >> $GITHUB_ENV | |
| # Wait for proxy to be ready | |
| sleep 5 | |
| curl -f http://localhost:8001/api/v1/namespaces || exit 1 | |
| echo "kubectl proxy is running on port 8001" | |
| env: | |
| K8S_API: http://127.0.0.1:8001 | |
| - name: Run unit tests | |
| run: | | |
| cd packages/client | |
| pnpm run tests:unit | |
| - name: Run integration tests | |
| run: | | |
| cd packages/client | |
| pnpm run tests:integration | |
| env: | |
| K8S_API: http://127.0.0.1:8001 | |
| NODE_ENV: test | |
| - name: Check cluster state after tests | |
| if: always() | |
| run: | | |
| echo "=== Namespaces ===" | |
| kubectl get namespaces | |
| echo "=== Pods in all namespaces ===" | |
| kubectl get pods --all-namespaces | |
| echo "=== Events ===" | |
| kubectl get events --all-namespaces --sort-by='.lastTimestamp' | tail -20 |