# End-To-End Tests: CI for starting a full ETH private network, deploying AVS and running tests. # # Overview: # 1. Start kurtosis network # 2. Deploy AVS contracts # 3. Start DataHaven node # 4. Run E2E tests name: E2E - Kurtosis Deploy and Verify on: workflow_dispatch: inputs: image-tag: description: "The tag of the docker image" required: true type: string workflow_call: inputs: image-tag: description: "The tag of the docker image" required: true type: string secrets: DOCKERHUB_USERNAME: required: false DOCKERHUB_TOKEN: required: false permissions: contents: read packages: read env: FOUNDRY_PROFILE: ci LOG_LEVEL: debug DOCKER_HOST: unix:///run/user/1020/podman/podman.sock KURTOSIS_CORE_IMAGE: docker.io/kurtosistech/core KURTOSIS_ENGINE_IMAGE: docker.io/kurtosistech/engine KURTOSIS_VERSION: 1.15.2 INJECT_CONTRACTS: false jobs: kurtosis: runs-on: group: DH-Testing name: E2E Tests with Kurtosis Ethereum Network defaults: run: working-directory: test steps: - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - uses: oven-sh/setup-bun@v2 with: bun-version-file: test/.bun-version - name: Check for outdated state-diff.json run: bun ./scripts/check-generated-state.ts - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - name: Pull Kurtosis images run: | docker pull ${{ env.KURTOSIS_CORE_IMAGE }}:${{ env.KURTOSIS_VERSION }} docker pull ${{ env.KURTOSIS_ENGINE_IMAGE }}:${{ env.KURTOSIS_VERSION }} - name: Install Kurtosis run: | # Install Kurtosis locally without sudo # SHA256 checksum for release kurtosis binary (v1.15.2) KURTOSIS_SHA256="5da4731180f60021bbb1d313e1d2994b7d0fcdeae1a2f2081c620cf51a265463" if ! command -v kurtosis &> /dev/null; then echo "Installing Kurtosis $KURTOSIS_VERSION locally" mkdir -p ~/.local/bin wget -q -O kurtosis-cli.tar.gz "https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases/download/${KURTOSIS_VERSION}/kurtosis-cli_${KURTOSIS_VERSION}_linux_amd64.tar.gz" tar -xzf kurtosis-cli.tar.gz -C ~/.local/bin rm kurtosis-cli.tar.gz # Verify checksum before making executable echo "Verifying kurtosis checksum..." echo "${KURTOSIS_SHA256} $HOME/.local/bin/kurtosis" | sha256sum -c - chmod +x ~/.local/bin/kurtosis echo "$HOME/.local/bin" >> $GITHUB_PATH export PATH="$HOME/.local/bin:$PATH" else echo "Kurtosis is already installed: $(kurtosis version)" fi kurtosis analytics disable kurtosis version - name: Configure Kurtosis cluster = podman run: | # Get the config path from Kurtosis itself (portable) CFG_PATH="$(kurtosis config path)" mkdir -p "$(dirname "$CFG_PATH")" # Create/update config with a podman cluster entry cat > "$CFG_PATH" <<'YML' config-version: 6 should-send-metrics: true kurtosis-clusters: docker: type: "docker" podman: type: "podman" YML kurtosis cluster set podman kurtosis cluster get - name: Start Kurtosis engine with Podman run: | kurtosis engine stop kurtosis clean kurtosis engine start kurtosis engine status - uses: actions/cache@v4 with: path: ~/.bun/install/cache key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} restore-keys: | ${{ runner.os }}-bun- - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Docker Hub if: github.repository == 'datahaven-xyz/datahaven' uses: docker/login-action@v3 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Download Snowbridge relay binary run: | docker create --name temp datahavenxyz/snowbridge-relay:latest mkdir -p tmp/bin docker cp temp:/usr/local/bin/snowbridge-relay tmp/bin/ chmod +x tmp/bin/snowbridge-relay docker rm -fv temp tmp/bin/snowbridge-relay --help - name: Pull DataHaven node image run: | docker pull ghcr.io/datahaven-xyz/datahaven/datahaven:${{ inputs.image-tag }} docker tag ghcr.io/datahaven-xyz/datahaven/datahaven:${{ inputs.image-tag }} datahavenxyz/datahaven:local - run: bun install - name: Run E2E tests run: bun test:e2e - name: Delete volumes not used if: always() run: podman system prune --volumes -f