Merge pull request #200 from bbrowning/gemini-fixes #478
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| detect-changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| containers: ${{ steps.filter.outputs.containers }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| - 'Makefile' | |
| - '.github/workflows/**' | |
| containers: | |
| - 'containers/**' | |
| lint: | |
| name: Lint & Type Check | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.code == 'true' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Run linter | |
| run: make lint | |
| - name: Run type checker | |
| run: make typecheck | |
| unit-tests: | |
| name: Unit Tests | |
| needs: [detect-changes, lint] | |
| if: needs.detect-changes.outputs.code == 'true' | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Run unit tests | |
| run: make test | |
| podman-integration: | |
| name: Podman Integration Tests | |
| needs: [detect-changes, lint, unit-tests] | |
| if: always() && !failure() && !cancelled() && (needs.detect-changes.outputs.code == 'true' || needs.detect-changes.outputs.containers == 'true') | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Verify Podman | |
| run: | | |
| podman version | |
| podman info | |
| - name: Build test images | |
| run: make build | |
| - name: Run Podman integration tests | |
| run: make test-podman | |
| kubernetes-integration: | |
| name: Kubernetes Integration Tests | |
| needs: [detect-changes, lint, unit-tests] | |
| if: always() && !failure() && !cancelled() && (needs.detect-changes.outputs.code == 'true' || needs.detect-changes.outputs.containers == 'true') | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Install oc CLI | |
| run: | | |
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | tar xzf - -C /usr/local/bin oc kubectl | |
| oc version --client | |
| - name: Create Kind cluster | |
| uses: helm/kind-action@v1 | |
| with: | |
| cluster_name: paude-test | |
| - name: Verify cluster access | |
| run: | | |
| kubectl cluster-info | |
| oc cluster-info | |
| - name: Build and load images into Kind | |
| run: | | |
| # Build images locally with Podman | |
| make build | |
| # Kubernetes expands short image names to docker.io/library/ prefix. | |
| # Tag images with full reference so containerd stores them with the | |
| # exact name Kubernetes will look for. | |
| podman tag localhost/paude-base-centos10:latest docker.io/library/paude-base-centos10:latest | |
| podman tag localhost/paude-proxy-centos10:latest docker.io/library/paude-proxy-centos10:latest | |
| # Save podman images to tarballs (kind can't read from podman storage directly) | |
| podman save docker.io/library/paude-base-centos10:latest -o /tmp/paude-base.tar | |
| podman save docker.io/library/paude-proxy-centos10:latest -o /tmp/paude-proxy.tar | |
| # Load images into Kind cluster from tarballs | |
| kind load image-archive /tmp/paude-base.tar --name paude-test | |
| kind load image-archive /tmp/paude-proxy.tar --name paude-test | |
| # Cleanup tarballs | |
| rm -f /tmp/paude-base.tar /tmp/paude-proxy.tar | |
| # Verify images are available in cluster | |
| docker exec paude-test-control-plane crictl images | grep paude || true | |
| - name: Run Kubernetes integration tests | |
| env: | |
| # Use the local image loaded into Kind, not the registry image | |
| PAUDE_K8S_TEST_IMAGE: paude-base-centos10:latest | |
| # Use IfNotPresent since images are pre-loaded into Kind | |
| PAUDE_IMAGE_PULL_POLICY: IfNotPresent | |
| run: make test-kubernetes |