Add justfile to support development commands on Windows #657
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: | |
| - dev | |
| paths-ignore: | |
| - "*.md" | |
| pull_request: | |
| branches: | |
| - dev | |
| paths-ignore: | |
| - "*.md" | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.9, 3.14] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Python | |
| id: setup-python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| activate-environment: true | |
| - name: Install just via uv | |
| run: | | |
| uv tool install rust-just | |
| echo "$(uv tool dir --bin)" >> "$GITHUB_PATH" | |
| - name: Check code style and Type Hints | |
| run: just check | |
| ci: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| 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 | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| tortoise-orm: | |
| - tortoise021 | |
| - tortoise022 | |
| - tortoise023 | |
| - tortoise024 | |
| - tortoise025 | |
| - tortoise11 | |
| exclude: | |
| - python-version: "3.9" | |
| tortoise-orm: "tortoise11" | |
| steps: | |
| - name: Start MySQL | |
| run: sudo systemctl start mysql.service | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| enable-cache: true | |
| activate-environment: true | |
| - name: Install just via pipx | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pipx | |
| pipx install rust-just | |
| pipx ensurepath | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Install dependencies | |
| run: just deps '--no-extra=psycopg' | |
| - name: Install TortoiseORM v0.21 | |
| if: matrix.tortoise-orm == 'tortoise021' | |
| run: | | |
| uv pip install --upgrade "tortoise-orm>=0.21,<0.22" | |
| uv pip install --upgrade "aiosqlite<0.22" | |
| - name: Install TortoiseORM v0.22 | |
| if: matrix.tortoise-orm == 'tortoise022' | |
| run: | | |
| uv pip install --upgrade "tortoise-orm>=0.22,<0.23" | |
| uv pip install --upgrade "aiosqlite<0.22" | |
| - name: Install TortoiseORM v0.23 | |
| if: matrix.tortoise-orm == 'tortoise023' | |
| run: | | |
| uv pip install --upgrade "tortoise-orm>=0.23,<0.24" | |
| uv pip install --upgrade "aiosqlite<0.22" | |
| - name: Install TortoiseORM v0.24 | |
| if: matrix.tortoise-orm == 'tortoise024' | |
| run: | | |
| uv pip install --upgrade "tortoise-orm>=0.24,<0.25" | |
| uv pip install --upgrade "aiosqlite<0.22" | |
| - name: Install TortoiseORM v0.25 | |
| if: matrix.tortoise-orm == 'tortoise025' | |
| run: uv pip install --upgrade "tortoise-orm>=0.25,<0.26" | |
| - name: Install TortoiseORM v1.1 | |
| if: matrix.tortoise-orm == 'tortoise11' | |
| run: uv pip install --upgrade "tortoise-orm<1.2" | |
| - name: Run tests for postgres | |
| run: | |
| just test_postgres | |
| env: | |
| POSTGRES_PASS: 123456 | |
| POSTGRES_HOST: 127.0.0.1 | |
| POSTGRES_PORT: 5432 | |
| - name: Run tests for mysql | |
| run: | |
| just test_mysql | |
| env: | |
| MYSQL_PASS: root | |
| MYSQL_HOST: 127.0.0.1 | |
| MYSQL_PORT: 3306 | |
| - name: Run tests for sqlite | |
| run: | |
| just test_sqlite | |
| - name: Show test coverage | |
| run: just report | |
| nuitkaSupport: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| strategy: | |
| matrix: | |
| python-version: [3.13] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| enable-cache: true | |
| activate-environment: true | |
| - name: Install just via taiki-e/install-action | |
| uses: taiki-e/install-action@just | |
| - name: Install dependencies | |
| run: | | |
| just deps '--no-dev --no-group test' | |
| uv pip install nuitka | |
| sudo apt install -y patchelf | |
| - name: Run tests for nuitka | |
| run: | | |
| cd tests/assets/nuitka_project | |
| ./build.sh | |
| ./dist/main.dist/minirepro | |
| uv pip install imp2importlib | |
| ./build.sh | |
| ./dist/main.dist/minirepro | |
| asyncmySupport: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Start MySQL | |
| run: sudo systemctl start mysql.service | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| enable-cache: true | |
| python-version: '3.13' | |
| activate-environment: true | |
| - name: Install just via setup-just | |
| uses: extractions/setup-just@v3 | |
| - name: Install dependencies | |
| run: uv sync --group test --extra toml --extra asyncmy | |
| - name: Test MySQL with asyncmy | |
| run: just test_mysql | |
| env: | |
| MYSQL_PASS: root | |
| MYSQL_HOST: 127.0.0.1 | |
| MYSQL_PORT: 3306 | |
| # Verify `poetry add aerich` work | |
| AERICH_TEST_POETRY_ADD: 1 | |
| - name: Show test coverage | |
| run: just report | |
| postgresVector: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| services: | |
| postgres: | |
| image: ankane/pgvector:latest | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: 123456 | |
| POSTGRES_USER: postgres | |
| options: --health-cmd=pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| enable-cache: true | |
| python-version: '3.13' | |
| activate-environment: true | |
| - name: Install just via apt | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y just | |
| - name: Install dependencies | |
| run: uv pip install --group vector --group test -e ".[toml,mysql]" | |
| - name: Test tortoise vector | |
| run: just test_postgres_vector | |
| env: | |
| POSTGRES_PASS: 123456 | |
| POSTGRES_HOST: 127.0.0.1 | |
| POSTGRES_PORT: 5432 | |
| - name: Show test coverage | |
| run: just report | |
| psycopgSupport: | |
| runs-on: ${{ matrix.os }} | |
| needs: lint | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - uses: ikalnytskyi/action-setup-postgres@v7 | |
| with: | |
| username: postgres | |
| password: 123456 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| enable-cache: true | |
| activate-environment: true | |
| - name: Install just via apt | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y just | |
| # Windows alternatives: | |
| # winget install --id Casey.Just --exact | |
| # uv tool install rust-just | |
| # pipx install rust-just | |
| - name: Install just via Chocolatey | |
| if: runner.os == 'Windows' | |
| run: choco install just -y | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --group test -e ".[toml,psycopg,mysql]" | |
| - name: Test psycopg | |
| run: just test_psycopg | |
| env: | |
| POSTGRES_HOST: 127.0.0.1 | |
| POSTGRES_PASS: 123456 | |
| POSTGRES_PORT: 5432 | |
| - name: Show test coverage | |
| run: just report |