5454 needs : [uv-check]
5555 runs-on : ubuntu-latest
5656
57+ strategy :
58+ fail-fast : false
59+ matrix :
60+ component : [package, tests]
61+
5762 steps :
5863 - uses : actions/checkout@v6
5964
6873 enable-cache : true
6974
7075 - name : Install mypy From Locked Dependencies
71- run : uv sync --no-group dev --group type-check
76+ run : |
77+ if [ "${{matrix.component}}" == "package" ]; then
78+ ARGS=""
79+ elif [ "${{matrix.component}}" == "tests" ]; then
80+ ARGS="--group test"
81+ else
82+ echo "Error: Unknown matrix.component value: '${{matrix.component}}'" >&2
83+ exit 1
84+ fi
85+
86+ uv sync --no-group dev --group type-check $ARGS
7287
7388 - id : store-hashed-python-version
7489 name : Store Hashed Python Version
@@ -77,11 +92,21 @@ jobs:
7792
7893 - uses : actions/cache@v4
7994 with :
80- key : mypy|${{steps.store-hashed-python-version.outputs.hashed_python_version}}
95+ key : mypy|${{steps.store-hashed-python-version.outputs.hashed_python_version}}|${{matrix.component}}
8196 path : ./.mypy_cache
8297
83- - name : Run mypy
84- run : uv run -- mypy . # TODO: Add GitHub workflows output format
98+ - name : Run mypy # TODO: Add GitHub workflows output format
99+ run : |
100+ if [ "${{matrix.component}}" == "package" ]; then
101+ ARGS=". --exclude tests/"
102+ elif [ "${{matrix.component}}" == "tests" ]; then
103+ ARGS="tests/"
104+ else
105+ echo "Error: Unknown matrix.component value: '${{matrix.component}}'" >&2
106+ exit 1
107+ fi
108+
109+ uv run -- mypy $ARGS
85110
86111 pre-commit : # yamllint disable-line rule:key-ordering
87112 env :
@@ -128,7 +153,7 @@ jobs:
128153
129154 - name : Save pre-commit Checks Which Require Skipping
130155 run : |
131- if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "${{ github.event.repository.default_branch }}" ]]; then
156+ if [[ "${{github.event_name}}" == "push" && "${{github.ref_name}}" == "${{github.event.repository.default_branch}}" ]]; then
132157 echo "SKIP=check-github-workflows,ruff-check,uv-lock,gitlint-ci" >> $GITHUB_ENV
133158 else
134159 echo "SKIP=check-github-workflows,ruff,uv-lock" >> $GITHUB_ENV
@@ -205,13 +230,13 @@ jobs:
205230 - name : Run pytest
206231 run : uv run pytest --cov --cov-branch --cov-report=xml --junitxml=junit.xml
207232
208- - if : ${{ !cancelled() }}
233+ - if : ${{!cancelled()}}
209234 name : Upload test results to Codecov
210235 uses : codecov/test-results-action@v1
211236 with :
212237 use_oidc : true
213238
214- - if : ${{ !cancelled() }}
239+ - if : ${{!cancelled()}}
215240 name : Upload coverage report to Codecov
216241 uses : codecov/codecov-action@v5
217242 with :
@@ -318,6 +343,6 @@ jobs:
318343 steps :
319344 - name : Create GitHub Release
320345 env : # yamllint disable-line rule:key-ordering
321- GITHUB_TOKEN : ${{ github.token }}
322- run : gh release create '${{ github.ref_name }}' --repo '${{github.repository}}' --verify-tag
346+ GITHUB_TOKEN : ${{github.token}}
347+ run : gh release create '${{github.ref_name}}' --repo '${{github.repository}}' --verify-tag
323348 --generate-notes
0 commit comments