8000 ci: add ci/local-ci.sh to replay the pull-request CI jobs on one machine by adeelahmad · Pull Request #181 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

ci: add ci/local-ci.sh to replay the pull-request CI jobs on one machine - #181

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-gtjiy6
Oct 5, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-gtjiy6

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Before: the only way to know whether a PR passes CI was a runner. When the runner was down, PRs were merged on hand-picked local suites.

After: ci/local-ci.sh [REF | --pr N] [--title "…"] [--jobs …] runs the same jobs as ci.yml, pre-commit.yml and pr-title.yml in one command:

  • the embedded backend job (ruff, mypy, OpenAPI drift, pytest with coverage)
  • the backend tests against a SurrealDB 3.2.4 server in Docker on tmpfs
  • Next.js (lint, tsc, jest coverage, build)
  • pre-commit on all files
  • the Conventional Commit title check

It prints a pass/fail table. --pr N tests the PR head merged into the latest main, as GitHub's pull_request event does.

How: each run uses a throwaway git worktree, so your checkout is never touched. Logs and summary.md go to .local-ci/ (gitignored). The env matches the workflows, and NODE_ENV is unset so jest works in containers that set it to production. The SurrealDB container gets a per-run name and a random port, and it is removed on exit.

I used it today to check main (it found the mypy error fixed in #178) and every open PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_016Z1gJcSd2Kp39i5j5KZivi


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Z1gJcSd2Kp39i5j5KZivi
Copy link
Copy Markdown
Owner Author

Local CI: green. The self-hosted runner is down, so I ran ci/local-ci.sh --pr 181, which tests the head merged into the latest main.

Local CI on PR #181 head 98a0395 merged into main f69d6af, 2026-10-05 08:57 UTC

Job Result Time
FastAPI (embedded SurrealDB) pass 352s
FastAPI (SurrealDB server) pass 217s
Next.js pass 191s
pre-commit pass 71s
PR title pass 0s

Generated by Claude Code

@adeelahmad
adeelahmad merged commit d36c44a into main Oct 5, 2026
5 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-gtjiy6 branch October 5, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0