Skip to content

chore: add GitHub Actions workflow for publishing to PyPI #5

chore: add GitHub Actions workflow for publishing to PyPI

chore: add GitHub Actions workflow for publishing to PyPI #5

Workflow file for this run

name: Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
# enable colored output
PY_COLORS: 1
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
enable-cache: true
python-version: ${{ matrix.python-version }}
cache-dependency-glob: |
uv.lock
pyproject.toml
- name: Install dependencies
run: uv sync --locked
- name: Run all tests
run: uv run pytest
env:
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }}
- name: Optimize uv cache for CI
run: uv cache prune --ci