build: pyproject migration, shared tooling (ruff/pylint/uv), lint cleanup & typing #16
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: Tests | |
| on: | |
| push: | |
| branches: [ dtq ] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Matches the DSpace-ISstag-integration consumer CI matrix. | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: | | |
| pyproject.toml | |
| requirements-test.txt | |
| - name: Install package + test deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| pip install -r requirements-test.txt | |
| - name: Run tests | |
| run: python -m pytest tests/ -v | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Ruff | |
| run: uvx ruff@0.12.7 check dspace_rest_client tests | |
| - name: Pylint | |
| run: >- | |
| uvx --with requests --with pysolr pylint@3.3.7 | |
| --rcfile=pyproject.toml dspace_rest_client | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Mypy | |
| # Non-blocking: strict typing is being introduced incrementally, so a | |
| # mypy failure is reported but does not fail the (green) job. | |
| continue-on-error: true | |
| run: uvx --with requests --with pysolr mypy dspace_rest_client |