-
Notifications
You must be signed in to change notification settings - Fork 2
ci: add PR-gate workflow running pytest on every PR #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||
| name: Lint and Test | ||||||||||
|
|
||||||||||
| on: | ||||||||||
| pull_request: | ||||||||||
| branches: [main, "feat/**", "fix/**"] | ||||||||||
| push: | ||||||||||
| branches: [main] | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| lint-and-test: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| strategy: | ||||||||||
| fail-fast: false | ||||||||||
| matrix: | ||||||||||
|
Comment on lines
+9
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/test.yml
Line: 9-14
Comment:
**No job-level timeout set**
Without `timeout-minutes`, a hung test (e.g. a socket that never resolves against the placeholder `API_URL`) will block the runner until GitHub's default 6-hour hard limit. Because the matrix spawns two jobs per run, a single stuck test can hold two runners for hours. Adding `timeout-minutes: 10` (or a value appropriate to your 167-test suite) on the job keeps failures fast.
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||
| python-version: ["3.11", "3.12"] | ||||||||||
| steps: | ||||||||||
| - uses: actions/checkout@v4 | ||||||||||
|
|
||||||||||
| - uses: actions/setup-python@v5 | ||||||||||
| with: | ||||||||||
| python-version: ${{ matrix.python-version }} | ||||||||||
|
|
||||||||||
| - name: Install uv | ||||||||||
| uses: astral-sh/setup-uv@v6 | ||||||||||
| with: | ||||||||||
| version: "0.6.14" | ||||||||||
| enable-cache: true | ||||||||||
|
|
||||||||||
| - name: Install dependencies | ||||||||||
| run: uv sync --dev --all-extras | ||||||||||
|
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/test.yml
Line: 29-30
Comment:
The `uv sync` command here uses `--all-extras`, but `main.yml` (the release pipeline) uses `uv sync --dev` without `--all-extras`. If the package has optional extras, the test environment will include dependencies that the release build does not, potentially hiding missing-dependency failures that real users would hit.
```suggestion
- name: Install dependencies
run: uv sync --dev
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||
|
|
||||||||||
| - name: Create test env | ||||||||||
| run: cp tests/sample.env tests/.env | ||||||||||
|
|
||||||||||
| - name: Tests (pytest) | ||||||||||
| run: uv run pytest tests/ -v | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint-and-testand the workflow is called "Lint and Test", but there is no lint step. The PR description explicitly defers lint, but the names will be misleading for any required check configuration or status badge. Consider renaming totest/ "Test" to match what the workflow actually does, then rename again when lint is added.Prompt To Fix With AI