Update pyproject.toml #2
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/CD Pipeline | |
| on: | |
| push: | |
| branches: | |
| - "**" # 指定触发分支 | |
| paths: | |
| - "**" # 监控所有文件变更 | |
| jobs: | |
| build: | |
| if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Set up environment | |
| run: | | |
| uv venv | |
| uv sync | |
| - name: Get Python path | |
| run: | | |
| PYTHON_BIN="$(uv run python -c 'import sys; print(sys.executable)')" | |
| echo "PYTHON_BIN=$PYTHON_BIN" >> $GITHUB_ENV | |
| - name: Run Pyright | |
| uses: jakebailey/pyright-action@v2 | |
| with: | |
| python-path: ${{ env.PYTHON_BIN }} | |
| pylance-version: latest-release | |
| - name: Setup database | |
| run: | | |
| source ./.venv/bin/activate | |
| echo "DATABASE_URL=aiosqlite+:///db.sqlite3" > .env | |
| uv run nb orm upgrade | |
| - name: Run Load Test | |
| run: | | |
| echo "ADMIN_GROUP=1" >> .env | |
| echo "LOG_LEVEL=DEBUG" >> .env | |
| source ./.venv/bin/activate | |
| uv run amrita test | |
| - name: Check code format | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: check . --exit-non-zero-on-fix | |
| - name: Build package | |
| run: uv build |