feat: add GitHub Actions CI workflow#117
Open
dashitongzhi wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a GitHub Actions workflow to run Python CI checks (linting, type checking, and tests) on pushes and pull requests.
Changes:
- Introduces a
Python CIworkflow triggered onpushandpull_request - Runs a test matrix across Python 3.9–3.12
- Adds steps for dependency install, flake8 lint, mypy type check, and test execution
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cache: 'pip' | ||
| - name: Install dependencies | ||
| run: | | ||
| pip install -e . 2>/dev/null || pip install -r requirements.txt 2>/dev/null || true |
| mypy . --ignore-missing-imports 2>/dev/null || echo "mypy not configured" | ||
| - name: Run tests | ||
| run: | | ||
| pytest --tb=short --cov=. --cov-report=term-missing 2>/dev/null || python -m unittest discover 2>/dev/null || echo "No test framework found" |
Comment on lines
+23
to
+33
| pip install -e . 2>/dev/null || pip install -r requirements.txt 2>/dev/null || true | ||
| pip install pytest pytest-cov flake8 mypy | ||
| - name: Lint with flake8 | ||
| run: | | ||
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| - name: Type check with mypy | ||
| run: | | ||
| mypy . --ignore-missing-imports 2>/dev/null || echo "mypy not configured" | ||
| - name: Run tests | ||
| run: | | ||
| pytest --tb=short --cov=. --cov-report=term-missing 2>/dev/null || python -m unittest discover 2>/dev/null || echo "No test framework found" |
| mypy . --ignore-missing-imports 2>/dev/null || echo "mypy not configured" | ||
| - name: Run tests | ||
| run: | | ||
| pytest --tb=short --cov=. --cov-report=term-missing 2>/dev/null || python -m unittest discover 2>/dev/null || echo "No test framework found" |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Python CI workflow for automated testing and linting