feat: migrate from poetry to uv #2093
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: ci | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| pull_request: | |
| branches-ignore: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| services: | |
| postgres: | |
| image: postgres | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: 123456 | |
| POSTGRES_USER: postgres | |
| options: --health-cmd=pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| mysql: | |
| image: mysql | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MYSQL_ROOT_PASSWORD: 123456 | |
| options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
| mssql: | |
| image: mcr.microsoft.com/mssql/server:2022-CU15-ubuntu-22.04 | |
| ports: | |
| - 1433:1433 | |
| env: | |
| ACCEPT_EULA: Y | |
| SA_PASSWORD: Abcd12345678 | |
| options: >- | |
| --health-cmd "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P Abcd12345678 -Q 'SELECT 1' -b -o /dev/null" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| TORTOISE_TEST_MODULES: tests.testmodels | |
| TORTOISE_MYSQL_PASS: 123456 | |
| TORTOISE_POSTGRES_PASS: 123456 | |
| TORTOISE_MSSQL_PASS: Abcd12345678 | |
| TORTOISE_MSSQL_DRIVER: ODBC Driver 18 for SQL Server | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/uv.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: Install ODBC driver | |
| run: | | |
| curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb | |
| sudo dpkg -i packages-microsoft-prod.deb | |
| sudo apt-get update | |
| sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 | |
| - name: Run ci | |
| run: uv run make ci | |
| - name: Test FastAPI/Blacksheep Example | |
| run: | | |
| PYTHONPATH=$DEST_FASTAPI uv run pytest $PYTEST_ARGS $DEST_FASTAPI/_tests.py | |
| PYTHONPATH=$DEST_BLACKSHEEP uv run pytest $PYTEST_ARGS $DEST_BLACKSHEEP/_tests.py | |
| PYTHONPATH=$DEST_SANIC uv run pytest $PYTEST_ARGS $DEST_SANIC/_tests.py | |
| env: | |
| DEST_FASTAPI: examples/fastapi | |
| DEST_BLACKSHEEP: examples/blacksheep | |
| DEST_SANIC: examples/sanic | |
| PYTHONDEVMODE: 1 | |
| PYTEST_ARGS: "-n auto --cov=tortoise --cov-append --cov-branch --tb=native -q" | |
| - name: Upload Coverage | |
| run: | | |
| pip3 install --upgrade coveralls | |
| coveralls --service=github | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
| COVERALLS_PARALLEL: true | |
| coveralls: | |
| name: Finish Coveralls | |
| needs: test | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Finished | |
| run: | | |
| pip3 install --upgrade coveralls | |
| coveralls --finish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |