feat: support yaml syntax #92
Workflow file for this run
This file contains 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-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Set PY variable | |
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
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-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.7", "3.8", "3.9"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- uses: hynek/setup-cached-uv@v1 | |
with: | |
cache-suffix: -tests-${{ matrix.python-version }}-${{ env.WEEK }} | |
- name: Install dependencies | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install '.[dev]' --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Test with Pytest on Python ${{ matrix.python-version }} | |
run: | | |
pip install pydantic -U | |
coverage run -m pytest | |
- name: Test with Pytest on Python ${{ matrix.python-version }} with pydantic v1 | |
run: | | |
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-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- uses: hynek/setup-cached-uv@v1 | |
with: | |
cache-suffix: -docs-${{ matrix.python-version }}-${{ env.WEEK }} | |
- name: Install dependencies | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install '.[dev]' --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Build documentation | |
run: | | |
mkdocs build --clean | |
Installation: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- uses: hynek/setup-cached-uv@v1 | |
with: | |
cache-suffix: -tests-${{ matrix.python-version }}-${{ env.WEEK }} | |
- name: Install library | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install . |