Skip to content

feat(cli): update quickstarts with package manager support, e2e tests for quickstarts #3

feat(cli): update quickstarts with package manager support, e2e tests for quickstarts

feat(cli): update quickstarts with package manager support, e2e tests for quickstarts #3

Workflow file for this run

name: cli-e2e-tests
on:
pull_request:
paths:
- "cmd/hatchet-cli/cli/templates/**"
- "cmd/hatchet-cli/cli/quickstart.go"
- "cmd/hatchet-cli/cli/internal/templater/**"
- "cmd/hatchet-cli/cli/quickstart_e2e_test.go"
- ".github/workflows/test-templates.yml"
push:
branches:
- main
paths:
- "cmd/hatchet-cli/cli/templates/**"
- "cmd/hatchet-cli/cli/quickstart.go"
- "cmd/hatchet-cli/cli/internal/templater/**"
- "cmd/hatchet-cli/cli/quickstart_e2e_test.go"
jobs:
test-templates:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Poetry
run: pipx install poetry
- name: Install uv
run: pip install uv
- name: Install pnpm
run: npm install -g pnpm
- name: Install Yarn
run: npm install -g yarn
- name: Install Bun
uses: oven-sh/setup-bun@v1
- name: Build CLI
run: |
cd cmd/hatchet-cli
go build -o hatchet-cli
sudo mv hatchet-cli /usr/local/bin/hatchet
hatchet --version
- name: Start Hatchet server
run: |
echo "Starting Hatchet server (this will wait until healthy)..."
hatchet server start --profile local --dashboard-port 8080
echo "Hatchet server is ready!"
- name: Verify local profile was created
run: |
hatchet profile list
- name: Run template E2E tests
run: |
cd cmd/hatchet-cli/cli
go test -tags e2e_cli -run TestQuickstartTemplates -v -timeout 15m
env:
# Ensure tests don't try to interact with stdin
CI: true
- name: Show server logs on failure
if: failure()
run: |
echo "=== Hatchet Container Logs ==="
docker logs hatchet-cli-hatchet-1 2>&1 || echo "Could not get hatchet container logs"
echo ""
echo "=== Postgres Container Logs ==="
docker logs hatchet-cli-postgres-1 2>&1 || echo "Could not get postgres container logs"
echo ""
echo "=== All Containers ==="
docker ps -a
- name: Cleanup
if: always()
run: |
# Stop Hatchet server (this will stop the containers)
hatchet server stop --profile local || true
# Cleanup any remaining docker containers
docker ps -q --filter "label=com.docker.compose.project=hatchet-cli" | xargs -r docker stop || true
docker ps -aq --filter "label=com.docker.compose.project=hatchet-cli" | xargs -r docker rm || true