fix: errors #4
This file contains hidden or 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
| name: test | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "**.py" | |
| - "**.pyi" | |
| - ".github/workflows/test.yaml" | |
| - "pyproject.toml" | |
| - "ruff.toml" | |
| - "pyrightconfig.json" | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| task: | |
| - name: lint | |
| cmd: uv run poe lint | |
| - name: mypy | |
| cmd: uv run poe mypy | |
| - name: pyright | |
| cmd: uv run poe pyright | |
| - name: pytest | |
| cmd: uv run pytest src/tests/ -v | |
| env: | |
| PYTHON_VERSION: "3.12" | |
| UV_CACHE_DIR: /tmp/.uv-cache | |
| name: ${{ matrix.task.name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Set up Python | |
| id: setup-python | |
| run: | | |
| uv python install ${{ env.PYTHON_VERSION }} | |
| uv python pin ${{ env.PYTHON_VERSION }} | |
| uv lock | |
| PY=$(uv run python -VV | shasum -a 256 | cut -d' ' -f1) | |
| echo PY: $PY | |
| echo "PY=$PY" >> "$GITHUB_OUTPUT" | |
| - name: Restore uv cache | |
| uses: actions/cache@v5 | |
| id: uv-cache | |
| with: | |
| path: ${{ env.UV_CACHE_DIR }} | |
| key: uv-${{ steps.setup-python.outputs.PY }}-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ steps.setup-python.outputs.PY }}-${{ hashFiles('uv.lock') }} | |
| uv-${{ steps.setup-python.outputs.PY }} | |
| - name: Install dependencies | |
| if: steps.uv-cache.outputs.cache-hit != 'true' | |
| run: uv sync | |
| - name: Run ${{ matrix.task.name }} | |
| run: ${{ matrix.task.cmd }} | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci |