-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.36 KB
/
PR.yaml
File metadata and controls
58 lines (48 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Pull Requests CI/CD Pipeline
on:
pull_request:
branches:
- "**"
paths:
- "**"
jobs:
check:
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
uv pip install .
- 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
amrita 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 # 生成构建产物到dist目录