generated from yanyongyu/python-poetry-template
-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 CI: add pyright checking workflow (#185)
- Loading branch information
Showing
9 changed files
with
260 additions
and
82 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,71 @@ | ||
name: Pyright Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
paths: | ||
- "envs/**" | ||
- "githubkit/**" | ||
- "tests/**" | ||
- "codegen/**" | ||
- ".github/actions/setup-python/**" | ||
- ".github/workflows/pyright.yml" | ||
- "**/pyproject.toml" | ||
- "**/poetry.lock" | ||
|
||
jobs: | ||
lint-githubkit: | ||
name: GitHubKit Lint | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: pyright-${{ github.ref }}-${{ matrix.env }} | ||
cancel-in-progress: true | ||
strategy: | ||
matrix: | ||
env: [pydantic-v1, pydantic-v2] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Python environment | ||
uses: ./.github/actions/setup-python | ||
with: | ||
env-dir: ./envs/${{ matrix.env }} | ||
no-root: true | ||
|
||
- run: | | ||
(cd ./envs/${{ matrix.env }} && echo "$(poetry env info --path)/bin" >> $GITHUB_PATH) | ||
if [ "${{ matrix.env }}" = "pydantic-v1" ]; then | ||
sed -i 's/PYDANTIC_V2 = true/PYDANTIC_V2 = false/g' ./pyproject.toml | ||
fi | ||
shell: bash | ||
- name: Run Pyright | ||
uses: jakebailey/pyright-action@v2 | ||
with: | ||
pylance-version: latest-release | ||
|
||
lint-codegen: | ||
name: Codegen Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Python environment | ||
uses: ./.github/actions/setup-python | ||
with: | ||
env-dir: . | ||
|
||
- run: | | ||
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH | ||
shell: bash | ||
- name: Run Pyright | ||
uses: jakebailey/pyright-action@v2 | ||
with: | ||
working-directory: ./codegen | ||
pylance-version: latest-release |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.