Test github actions #1
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: Kind TFT Full Suite | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: kind-tft-full-suite-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| kind-tft-full-suite: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 180 | |
| steps: | |
| - name: Checkout ovn-k8s-traffic-flow-tests | |
| uses: actions/checkout@v4 | |
| - name: Checkout dpu-simulator | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ovn-kubernetes/dpu-simulator | |
| ref: main | |
| path: dpu-simulator | |
| - name: Checkout OVN-Kubernetes (master) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ovn-org/ovn-kubernetes | |
| ref: master | |
| path: dpu-simulator/ovn-kubernetes | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: dpu-simulator/go.mod | |
| cache: true | |
| - name: Install libvirt development headers | |
| run: sudo apt-get update && sudo apt-get install -y libvirt-dev | |
| - name: Ensure podman is available | |
| # External test cases (POD_TO_EXTERNAL, HOST_TO_EXTERNAL) launch a | |
| # podman container on the runner. Pre-installed on ubuntu-24.04 today, | |
| # but install on-demand if a future image drops it. | |
| run: | | |
| if ! command -v podman >/dev/null 2>&1; then | |
| sudo apt-get install -y podman | |
| fi | |
| podman --version | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Set up Python for traffic flow tests | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install kind | |
| run: | | |
| KIND_VERSION=v0.31.0 | |
| curl -fsSLo /tmp/kind-linux-amd64 "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64" | |
| curl -fsSLo /tmp/kind-linux-amd64.sha256sum "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64.sha256sum" | |
| (cd /tmp && sha256sum -c kind-linux-amd64.sha256sum) | |
| chmod +x /tmp/kind-linux-amd64 | |
| sudo mv /tmp/kind-linux-amd64 /usr/local/bin/kind | |
| - name: Build dpu-sim | |
| working-directory: dpu-simulator | |
| run: make build | |
| - name: Disable containerd image store | |
| # Workaround for https://github.com/kubernetes-sigs/kind/issues/3795 | |
| run: | | |
| sudo mkdir -p /etc/docker | |
| [ -s "/etc/docker/daemon.json" ] && { | |
| cat "/etc/docker/daemon.json" | jq '. + {"features":{"containerd-snapshotter": false}}' | sudo tee /etc/docker/daemon.$$ | |
| } || { | |
| echo '{"features":{"containerd-snapshotter": false}}' | sudo tee /etc/docker/daemon.$$ | |
| } | |
| sudo mv -f /etc/docker/daemon.$$ /etc/docker/daemon.json | |
| sudo systemctl restart docker | |
| - name: Deploy KIND cluster (OVN-Kubernetes from source) | |
| working-directory: dpu-simulator | |
| run: ./bin/dpu-sim --config config-kind.yaml | |
| - name: Verify clusters are ready | |
| working-directory: dpu-simulator | |
| run: | | |
| kubectl wait --for=condition=Ready nodes --all \ | |
| --kubeconfig kubeconfig/dpu-sim-host.kubeconfig --timeout=25m | |
| - name: TFT Python venv | |
| working-directory: dpu-simulator | |
| run: ./bin/dpu-sim tft venv --config config-kind.yaml --tft-repo-path "$GITHUB_WORKSPACE" | |
| - name: Run traffic flow tests | |
| working-directory: dpu-simulator | |
| run: | | |
| ./bin/dpu-sim tft run \ | |
| --config config-kind.yaml \ | |
| --tft-repo-path "$GITHUB_WORKSPACE" \ | |
| --tft-config "$GITHUB_WORKSPACE/.github/tft-configs/full-suite.yaml" \ | |
| --check | |
| - name: Export kind logs on failure | |
| if: failure() | |
| run: | | |
| kind export logs /tmp/kind-logs --name dpu-sim-host 2>/dev/null || true | |
| kind export logs /tmp/kind-logs --name dpu-sim-dpu 2>/dev/null || true | |
| - name: Upload kind logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kind-tft-full-suite-kind-logs | |
| path: /tmp/kind-logs | |
| if-no-files-found: ignore | |
| - name: Upload TFT results on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kind-tft-full-suite-ft-logs | |
| path: ft-logs | |
| if-no-files-found: ignore | |
| - name: Cleanup | |
| if: always() | |
| working-directory: dpu-simulator | |
| run: ./bin/dpu-sim --config config-kind.yaml --cleanup || true |