Skip to content

Commit

Permalink
ci: typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravencentric committed Aug 11, 2024
1 parent fb85703 commit 4f9eb62
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ jobs:
if: matrix.os == 'macos-latest'
run: brew install carlocab/personal/unrar

- name: Run mypy
run: poetry run mypy .

- name: Run tests and generate coverage
run: |
poetry run coverage run -m pytest -vv
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Type Check

on:
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/typecheck.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/typecheck.yml'
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install pipx
run: python -m pip install pipx

- name: Install poetry
run: pipx install poetry

- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
name: Define a cache for the venv based on the dependencies lock file
with:
key: ubuntu-latest-3.12-${{ hashFiles('poetry.lock') }}
path: ./.venv

- name: Install the project dependencies
run: poetry install --all-extras

- name: Run mypy
run: poetry run mypy .
69 changes: 36 additions & 33 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f9eb62

Please sign in to comment.