-
Notifications
You must be signed in to change notification settings - Fork 2
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
ci: Add GitHub workflow to run code linting checks daily and on every push or pull request. #4
Changes from all commits
5c16686
73f5f7e
c73b17c
3a65e48
7dd08bb
083d17f
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,48 @@ | ||||||||||||||||||||||
name: "code-linting-checks" | ||||||||||||||||||||||
|
||||||||||||||||||||||
on: | ||||||||||||||||||||||
pull_request: | ||||||||||||||||||||||
push: | ||||||||||||||||||||||
schedule: | ||||||||||||||||||||||
# Run daily at 00:15 UTC (the 15 is to avoid periods of high load) | ||||||||||||||||||||||
- cron: "15 0 * * *" | ||||||||||||||||||||||
workflow_dispatch: | ||||||||||||||||||||||
|
||||||||||||||||||||||
permissions: {} | ||||||||||||||||||||||
|
||||||||||||||||||||||
concurrency: | ||||||||||||||||||||||
group: "${{github.workflow}}-${{github.ref}}" | ||||||||||||||||||||||
|
||||||||||||||||||||||
# Cancel in-progress jobs for efficiency | ||||||||||||||||||||||
cancel-in-progress: true | ||||||||||||||||||||||
|
||||||||||||||||||||||
jobs: | ||||||||||||||||||||||
lint: | ||||||||||||||||||||||
strategy: | ||||||||||||||||||||||
matrix: | ||||||||||||||||||||||
os: ["macos-latest", "ubuntu-latest"] | ||||||||||||||||||||||
runs-on: "${{matrix.os}}" | ||||||||||||||||||||||
Comment on lines
+20
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. 🛠️ Refactor suggestion Consider adding Windows to the matrix. The matrix strategy effectively covers macOS and Ubuntu, but consider adding Windows to ensure lint checks pass across all major platforms. matrix:
- os: ["macos-latest", "ubuntu-latest"]
+ os: ["macos-latest", "ubuntu-latest", "windows-latest"] 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
steps: | ||||||||||||||||||||||
- uses: "actions/checkout@v4" | ||||||||||||||||||||||
with: | ||||||||||||||||||||||
submodules: "recursive" | ||||||||||||||||||||||
|
||||||||||||||||||||||
- uses: "actions/setup-python@v5" | ||||||||||||||||||||||
with: | ||||||||||||||||||||||
python-version: "3.8" | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+30
to
+33
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. 🛠️ Refactor suggestion Consider using a more recent Python version. Python 3.8 is approaching end-of-life. Consider using Python 3.11 or 3.12 for better performance and newer features. with:
- python-version: "3.8"
+ python-version: "3.12" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
- name: "Install task" | ||||||||||||||||||||||
run: "npm install -g @go-task/cli" | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+34
to
+36
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. 🛠️ Refactor suggestion Improve task CLI installation. The global npm installation might require elevated privileges and lacks version pinning. Consider using a specific version and installing locally: -run: "npm install -g @go-task/cli"
+run: "npm install @go-task/[email protected]" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
- if: "matrix.os == 'macos-latest'" | ||||||||||||||||||||||
name: "Install coreutils (for md5sum)" | ||||||||||||||||||||||
run: "brew install coreutils" | ||||||||||||||||||||||
|
||||||||||||||||||||||
- name: "Log tool versions" | ||||||||||||||||||||||
run: |- | ||||||||||||||||||||||
md5sum --version | ||||||||||||||||||||||
python --version | ||||||||||||||||||||||
tar --version | ||||||||||||||||||||||
task --version | ||||||||||||||||||||||
|
||||||||||||||||||||||
- run: "task lint:check" |
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.
🛠️ Refactor suggestion
Consider adding minimum required permissions.
The empty permissions block follows the principle of least privilege, but the workflow might need specific permissions to post lint check results as PR comments.
Consider adding these minimum required permissions:
📝 Committable suggestion