-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add Python CI (compile + test gate) #3
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,41 @@ | ||
| name: Python CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| pull_request: | ||
| branches: [main, master] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: python-ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
|
Comment on lines
+22
to
+24
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. Pin GitHub Actions to immutable commit SHAs. Line 22 and Line 24 use movable tags ( Suggested change- - uses: actions/checkout@v6
+ - uses: actions/checkout@<full_commit_sha>
- - uses: actions/setup-python@v6
+ - uses: actions/setup-python@<full_commit_sha>🧰 Tools🪛 zizmor (1.25.2)[warning] 22-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 22-22: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 24-24: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
| with: | ||
| python-version: "3.11" | ||
| cache: pip | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
| if [ -f pyproject.toml ]; then pip install -e ".[dev]" || pip install -e . || true; fi | ||
|
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. Do not swallow editable-install failures. Line 33 ends with Suggested change- if [ -f pyproject.toml ]; then pip install -e ".[dev]" || pip install -e . || true; fi
+ if [ -f pyproject.toml ]; then pip install -e ".[dev]" || pip install -e .; fi🤖 Prompt for AI Agents |
||
| if [ -d tests ]; then pip install pytest; fi | ||
|
|
||
| - name: Compile | ||
| run: python -m compileall . | ||
|
|
||
| - name: Test | ||
| run: | | ||
| if [ -d tests ]; then pytest; else echo "No tests directory; compile check passed."; fi | ||
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.
Disable credential persistence in checkout step.
Line 22 currently leaves the Git auth token in local git config for later steps. Set
persist-credentials: falseto reduce token exposure during PR execution.Suggested change
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 22-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 22-22: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents