-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add GitHub Actions workflows for formatting, linting, and test covera… #1
Conversation
…ge; update README with Codecov badge
Reviewer's Guide by SourceryThis pull request introduces GitHub Actions workflows for formatting, linting, and test coverage. It also adds a Codecov badge to the README. Sequence diagram for GitHub Actions workflow executionsequenceDiagram
participant PR as Pull Request
participant GH as GitHub Actions
participant Fmt as Formatting Job
participant Lint as Linting Job
participant Test as Test Coverage Job
PR->>GH: Create/Update PR
activate GH
par Parallel Jobs
GH->>Fmt: Run formatting check
activate Fmt
Fmt-->>GH: Return formatting results
deactivate Fmt
and
GH->>Lint: Run linting check
activate Lint
Lint-->>GH: Return linting results
deactivate Lint
and
GH->>Test: Run test coverage
activate Test
Test-->>GH: Upload coverage report
deactivate Test
end
GH-->>PR: Update PR status
deactivate GH
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @ghodsizadeh - I've reviewed your changes - here's some feedback:
Overall Comments:
- The test coverage workflow is missing installation of the package dependencies. Please add
pip install -e .
or your package requirements to the dependencies installation step. - Please improve the PR description to better explain what workflows are being added and their purpose. This helps with future maintenance and understanding of the changes.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies |
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.
suggestion (performance): Add dependency caching to improve workflow performance
Using actions/cache for pip dependencies can significantly speed up workflow execution by avoiding repeated downloads.
Suggested implementation:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
Note: This assumes you have a requirements.txt file. If you're using a different dependency management file (like setup.py, pyproject.toml, etc.), you should adjust the hashFiles()
pattern accordingly. For example:
- For pyproject.toml:
hashFiles('**/pyproject.toml')
- For setup.py:
hashFiles('**/setup.py')
- For multiple files:
hashFiles('**/requirements.txt', '**/setup.py')
… and test execution
Add github workflow
Summary by Sourcery
CI: