Skip to content
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

added mypy reviewdog job for pull requests #71

Merged
merged 4 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ jobs:
uv venv
source .venv/bin/activate
uv sync
- name: Code linting
- name: Ruff linting and formatting check
run: |
source .venv/bin/activate
ruff check src/smolvault tests
ruff format --check src/smolvault tests
mypy src/smolvault
- name: Test with pytest
run: |
mkdir ~/.aws && touch ~/.aws/credentials && echo -e "[default]\naws_access_key_id = test\naws_secret_access_key = test" > ~/.aws/credentials
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: reviewdog
on: [pull_request]
jobs:
mypy:
name: runner / mypy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Load cached venv
id: cached-uv-dependencies
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/uv.lock') }}
- name: Install dependencies
run: |
pip install uv==0.4.15
uv venv
source .venv/bin/activate
uv sync
- uses: tsuyoshicho/action-mypy@v4
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-review
# Change reporter level if you need.
# GitHub Status Check won't become failure with warning.
level: warning
setup_command: |
source .venv/bin/activate
setup_method: adaptive
# Change the current directory to run mypy command.
# mypy command reads setup.cfg or other settings file in this path.
workdir: .
target: src