Multiline strings + move to uv everywhere, and cleanup the docs and ci #211
Workflow file for this run
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 and Linting | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| Linting: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Set PY variable | |
| run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Install pre-commit | |
| run: | | |
| pip install pre-commit | |
| pre-commit install | |
| - name: Run pre-commit | |
| run: SKIP=no-commit-to-branch pre-commit run --all-files | |
| Pytest: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - uses: hynek/setup-cached-uv@v2 | |
| with: | |
| cache-suffix: -tests-${{ matrix.python-version }}-${{ env.WEEK }} | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Test with Pytest on Python ${{ matrix.python-version }} | |
| run: | | |
| source .venv/bin/activate | |
| uv pip install pydantic -U | |
| coverage run -m pytest | |
| - name: Test with Pytest on Python ${{ matrix.python-version }} with pydantic v1 | |
| run: | | |
| source .venv/bin/activate | |
| uv pip install pydantic==1.10.7 | |
| coverage run -m pytest | |
| if: matrix.python-version == '3.9' | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-data-${{ matrix.python-version }} | |
| path: .coverage.* | |
| if-no-files-found: ignore | |
| include-hidden-files: true | |
| coverage: | |
| name: Coverage | |
| needs: Pytest | |
| uses: aphp/foldedtensor/.github/workflows/coverage.yml@main | |
| with: | |
| base-branch: main | |
| coverage-data-pattern: coverage-data-* | |
| coverage-report: coverage.txt | |
| coverage-badge: coverage.svg | |
| coverage-branch: coverage | |
| Documentation: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - uses: hynek/setup-cached-uv@v2 | |
| with: | |
| cache-suffix: -docs-${{ matrix.python-version }}-${{ env.WEEK }} | |
| - name: Install dependencies | |
| run: uv sync --group docs --group dev | |
| - name: Build documentation | |
| run: | | |
| source .venv/bin/activate | |
| mkdocs build --clean | |
| Installation: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - uses: hynek/setup-cached-uv@v2 | |
| with: | |
| cache-suffix: -tests-${{ matrix.python-version }}-${{ env.WEEK }} | |
| - name: Install library | |
| run: | | |
| pip install . |