Repository navigation
While you were away: what the team did since you were last here #209
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: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| name: Typecheck, test, build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/actions/setup | |
| - name: Typecheck | |
| run: pnpm --filter @godmode/shared --filter @godmode/core --filter @godmode/desktop typecheck | |
| - name: Core tests | |
| working-directory: packages/core | |
| run: bun test | |
| - name: Build web UI | |
| run: pnpm --filter @godmode/desktop build | |
| - name: Build standalone server (UI embedded) and smoke test it | |
| working-directory: packages/core | |
| run: bun run scripts/build.ts --smoke | |
| mobile: | |
| name: Phone app (typecheck) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| working-directory: apps/mobile | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.4.2" | |
| - run: bun install --frozen-lockfile | |
| - run: bun run typecheck | |
| desktop-shell: | |
| name: Desktop shell (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 40 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, macos-latest, windows-latest] | |
| defaults: | |
| run: | |
| working-directory: apps/desktop/src-tauri | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| working-directory: . | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf build-essential libssl-dev libxdo-dev | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: apps/desktop/src-tauri -> target | |
| - name: rustfmt | |
| if: runner.os == 'Linux' | |
| run: cargo fmt --check | |
| - name: cargo check | |
| run: cargo check --locked --all-targets | |
| - name: clippy | |
| run: cargo clippy --locked --all-targets -- -D warnings | |
| - name: tests | |
| run: cargo test --locked | |
| docker: | |
| name: Docker image (linux/amd64) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: false | |
| load: true | |
| tags: godmode-bot:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Smoke test | |
| run: | | |
| docker run -d --name godmode -p 7777:7777 godmode-bot:ci | |
| for _ in $(seq 1 60); do | |
| if curl -fsS http://127.0.0.1:7777/api/health; then break; fi | |
| sleep 1 | |
| done | |
| curl -fsS http://127.0.0.1:7777/ | grep -q '<div id="root">' | |
| docker exec godmode godmode version | |
| docker exec godmode claude --version | |
| docker exec godmode uv --version | |
| docker exec godmode chromium --version | |
| - name: Container logs | |
| if: always() | |
| run: docker logs godmode || true | |
| cloud: | |
| name: Cloud (typecheck, test, build) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_USER: godmode | |
| POSTGRES_PASSWORD: godmode | |
| POSTGRES_DB: godmode_cloud_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U godmode -d godmode_cloud_test" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 20 | |
| env: | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/actions/setup | |
| - name: Typecheck (next typegen + tsc) | |
| run: pnpm --filter @godmode/cloud typecheck | |
| - name: Tests | |
| run: pnpm --filter @godmode/cloud test | |
| env: | |
| # The suite drops and recreates the schema of this database; its name must contain "test". | |
| DATABASE_URL: postgres://godmode:godmode@localhost:5432/godmode_cloud_test | |
| - name: Build (next build + custom server bundle) | |
| run: pnpm --filter @godmode/cloud build | |
| - name: Build the dashboard the cloud serves | |
| run: pnpm --filter @godmode/desktop build:cloud | |
| cloud-docker: | |
| name: Cloud image (linux/amd64) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: apps/cloud/Dockerfile | |
| platforms: linux/amd64 | |
| push: false | |
| load: true | |
| tags: godmode-cloud:ci | |
| cache-from: type=gha,scope=cloud | |
| cache-to: type=gha,mode=max,scope=cloud | |
| - name: Smoke test (the compose stack with this image and its PostgreSQL) | |
| working-directory: apps/cloud | |
| env: | |
| DOMAIN: http://localhost:3000 | |
| run: | | |
| printf 'services:\n cloud:\n image: godmode-cloud:ci\n' > "$RUNNER_TEMP/compose.ci.yaml" | |
| compose() { docker compose -p godmode-cloud-ci -f docker-compose.yaml -f docker-compose.override.yaml -f "$RUNNER_TEMP/compose.ci.yaml" "$@"; } | |
| compose up -d --no-build | |
| # The image's healthcheck has to pass: Coolify's proxy only routes to healthy containers. | |
| status="" | |
| for _ in $(seq 1 60); do | |
| status=$(docker inspect --format '{{.State.Health.Status}}' "$(compose ps -q cloud)" 2>/dev/null || true) | |
| [ "$status" = healthy ] && break | |
| sleep 2 | |
| done | |
| [ "$status" = healthy ] || { echo "The cloud container is not healthy: ${status:-no status}"; exit 1; } | |
| curl -fsS http://localhost:3000/api/health | grep -q '"ok":true' | |
| # A page rendered by Next that reads the database: proves pg loads through .next/node_modules in the image. | |
| code="" | |
| for _ in $(seq 1 30); do | |
| code=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:3000/setup || true) | |
| [ "$code" = 200 ] && break | |
| sleep 2 | |
| done | |
| [ "$code" = 200 ] || { echo "GET /setup answered ${code:-nothing}, expected 200"; exit 1; } | |
| # The dashboard build and its version file are in the image. | |
| curl -fsS http://localhost:3000/ui/version.json | grep -q '"version"' | |
| - name: Container logs | |
| if: always() | |
| working-directory: apps/cloud | |
| run: docker compose -p godmode-cloud-ci logs --no-color || true |