Add GitHub Actions workflow for Python application#5
Conversation
This workflow installs Python dependencies, runs linting with flake8, and executes tests using pytest.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a GitHub Actions workflow to automate Python application testing and linting. The workflow is configured to run on pushes and pull requests to the main branch.
- Adds CI/CD automation with pytest and flake8
- Configures Python 3.10 environment
- Sets up automated testing on push and pull request events
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v3 |
There was a problem hiding this comment.
Consider using actions/setup-python@v5 instead of v3. The workflow uses actions/checkout@v4 which is recent, but setup-python@v3 is older. Using a more recent version ensures better compatibility and security updates.
| uses: actions/setup-python@v3 | |
| uses: actions/setup-python@v5 |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
| - name: Test with pytest | ||
| run: | | ||
| pytest |
There was a problem hiding this comment.
[nitpick] The pytest command lacks verbosity flags which could make CI output harder to debug. Consider adding -v flag for verbose output or -vv for even more detailed output, especially useful when tests fail in CI.
| pytest | |
| pytest -v |
Co-authored-by: AbdulDavids <125186956+AbdulDavids@users.noreply.github.com>
Co-authored-by: AbdulDavids <125186956+AbdulDavids@users.noreply.github.com>
…rror Fix f-string syntax error for Python 3.10 compatibility
This workflow installs Python dependencies, runs linting with flake8, and executes tests using pytest.