generated from opentensor/bittensor-subnet-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add linting and formatting workflow
- Loading branch information
1 parent
1a43294
commit 4c09539
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Development | ||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
lint_and_format: | ||
name: Linting and formatting checks | ||
uses: ./.github/workflows/lint-and-format.yml | ||
|
||
# build: | ||
# needs: lint_and_format | ||
# name: Build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
|
||
# # TODO |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Linting and formatting checks | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint_and_format: | ||
name: Lint and Format | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
uv sync | ||
- name: Check for linting errors | ||
run: | | ||
uv run ruff check | ||
- name: Check formatting | ||
run: | | ||
uv run ruff format --check |