Skip to content

Commit 7cee5bd

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f9899d2 + 587286a commit 7cee5bd

530 files changed

Lines changed: 54574 additions & 16835 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-docs.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@ jobs:
1212
steps:
1313
- name: checkout
1414
uses: actions/checkout@v6
15-
- name: nodejs installation
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v6.0.3
17+
with:
18+
version: 10.28.2
19+
- name: Setup Node.js
1620
uses: actions/setup-node@v6
1721
with:
18-
node-version: "18"
19-
- name: npm install
20-
run: npm add -D vitepress
21-
working-directory: './docs' # working-directory 指定 shell 命令运行目录
22-
- name: npm run build
23-
run: npm run docs:build
22+
node-version: "24.13.0"
23+
cache: "pnpm"
24+
cache-dependency-path: docs/pnpm-lock.yaml
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
working-directory: './docs'
28+
- name: Build docs
29+
run: pnpm run docs:build
2430
working-directory: './docs'
2531
- name: scp
2632
uses: appleboy/scp-action@v1.0.0

.github/workflows/coverage_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ jobs:
4141
4242
- name: Upload results to Codecov
4343
if: github.repository == 'AstrBotDevs/AstrBot'
44-
uses: codecov/codecov-action@v5
44+
uses: codecov/codecov-action@v6
4545
with:
4646
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/dashboard_ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,22 @@ jobs:
1414
- name: Checkout repository
1515
uses: actions/checkout@v6
1616

17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v6.0.3
19+
with:
20+
version: 10.28.2
21+
1722
- name: Setup Node.js
1823
uses: actions/setup-node@v6
1924
with:
2025
node-version: '24.13.0'
26+
cache: "pnpm"
27+
cache-dependency-path: dashboard/pnpm-lock.yaml
2128

22-
- name: npm install, build
29+
- name: Install and Build
30+
working-directory: dashboard
2331
run: |
24-
cd dashboard
25-
npm install pnpm -g
26-
pnpm install
27-
pnpm i --save-dev @types/markdown-it
32+
pnpm install --frozen-lockfile
2833
pnpm run build
2934
3035
- name: Inject Commit SHA

.github/workflows/docker-image.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ jobs:
7070
uses: docker/setup-buildx-action@v4.0.0
7171

7272
- name: Log in to DockerHub
73-
uses: docker/login-action@v4.0.0
73+
uses: docker/login-action@v4.1.0
7474
with:
7575
username: ${{ secrets.DOCKER_HUB_USERNAME }}
7676
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
7777

7878
- name: Login to GitHub Container Registry
7979
if: env.HAS_GHCR_TOKEN == 'true'
80-
uses: docker/login-action@v4.0.0
80+
uses: docker/login-action@v4.1.0
8181
with:
8282
registry: ghcr.io
8383
username: ${{ env.GHCR_OWNER }}
@@ -98,7 +98,7 @@ jobs:
9898
echo "EOF" >> $GITHUB_OUTPUT
9999
100100
- name: Build and Push Nightly Image
101-
uses: docker/build-push-action@v7.0.0
101+
uses: docker/build-push-action@v7.1.0
102102
with:
103103
context: .
104104
platforms: linux/amd64,linux/arm64
@@ -169,21 +169,21 @@ jobs:
169169
uses: docker/setup-buildx-action@v4.0.0
170170

171171
- name: Log in to DockerHub
172-
uses: docker/login-action@v4.0.0
172+
uses: docker/login-action@v4.1.0
173173
with:
174174
username: ${{ secrets.DOCKER_HUB_USERNAME }}
175175
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
176176

177177
- name: Login to GitHub Container Registry
178178
if: env.HAS_GHCR_TOKEN == 'true'
179-
uses: docker/login-action@v4.0.0
179+
uses: docker/login-action@v4.1.0
180180
with:
181181
registry: ghcr.io
182182
username: ${{ env.GHCR_OWNER }}
183183
password: ${{ secrets.GHCR_GITHUB_TOKEN }}
184184

185185
- name: Build and Push Release Image
186-
uses: docker/build-push-action@v7.0.0
186+
uses: docker/build-push-action@v7.1.0
187187
with:
188188
context: .
189189
platforms: linux/amd64,linux/arm64

.github/workflows/pr-title-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Validate PR title
17-
uses: actions/github-script@v8
17+
uses: actions/github-script@v9
1818
with:
1919
script: |
2020
const title = (context.payload.pull_request.title || "").trim();

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
echo "tag=$tag" >> "$GITHUB_OUTPUT"
5252
5353
- name: Setup pnpm
54-
uses: pnpm/action-setup@v4.4.0
54+
uses: pnpm/action-setup@v6.0.3
5555
with:
5656
version: 10.28.2
5757

@@ -64,11 +64,11 @@ jobs:
6464

6565
- name: Build dashboard dist
6666
shell: bash
67+
working-directory: dashboard
6768
run: |
68-
pnpm --dir dashboard install --frozen-lockfile
69-
pnpm --dir dashboard run build
70-
echo "${{ steps.tag.outputs.tag }}" > dashboard/dist/assets/version
71-
cd dashboard
69+
pnpm install --frozen-lockfile
70+
pnpm run build
71+
echo "${{ steps.tag.outputs.tag }}" > dist/assets/version
7272
zip -r "AstrBot-${{ steps.tag.outputs.tag }}-dashboard.zip" dist
7373
7474
- name: Upload dashboard artifact

.github/workflows/smoke_test.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,23 @@ on:
1313

1414
jobs:
1515
smoke-test:
16-
name: Run smoke tests
17-
runs-on: ubuntu-latest
16+
name: Smoke test (${{ matrix.os }}, Python ${{ matrix.python-version }})
17+
runs-on: ${{ matrix.os }}
1818
timeout-minutes: 10
19-
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os:
23+
- ubuntu-latest
24+
- macos-latest
25+
- windows-latest
26+
python-version:
27+
- '3.10'
28+
- '3.11'
29+
- '3.12'
30+
- '3.13'
31+
- '3.14'
32+
2033
steps:
2134
- name: Checkout
2235
uses: actions/checkout@v6
@@ -26,33 +39,21 @@ jobs:
2639
- name: Set up Python
2740
uses: actions/setup-python@v6
2841
with:
29-
python-version: '3.12'
30-
31-
- name: Install UV package manager
42+
python-version: ${{ matrix.python-version }}
43+
cache: 'pip'
44+
cache-dependency-path: requirements.txt
45+
46+
- name: Install uv
3247
run: |
33-
pip install uv
48+
python -m pip install --upgrade pip
49+
python -m pip install uv
3450
3551
- name: Install dependencies
3652
run: |
37-
uv sync
53+
uv pip install --system -r requirements.txt
3854
timeout-minutes: 15
3955

4056
- name: Run smoke tests
4157
run: |
42-
uv run main.py &
43-
APP_PID=$!
44-
45-
echo "Waiting for application to start..."
46-
for i in {1..60}; do
47-
if curl -f http://localhost:6185 > /dev/null 2>&1; then
48-
echo "Application started successfully!"
49-
kill $APP_PID
50-
exit 0
51-
fi
52-
sleep 1
53-
done
54-
55-
echo "Application failed to start within 30 seconds"
56-
kill $APP_PID 2>/dev/null || true
57-
exit 1
58+
python scripts/smoke_startup_check.py
5859
timeout-minutes: 2

.github/workflows/unit_tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'README*.md'
9+
- 'changelogs/**'
10+
- 'dashboard/**'
11+
pull_request:
12+
workflow_dispatch:
13+
14+
jobs:
15+
unit-tests:
16+
name: Run pytest suite
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v6
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install uv
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install uv
33+
34+
- name: Run tests
35+
run: |
36+
chmod +x scripts/run_pytests_ci.sh
37+
bash ./scripts/run_pytests_ci.sh ./tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ GenieData/
6363
.kilocode/
6464
.worktrees/
6565

66+
dashboard/bun.lock

AGENTS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ pnpm dev
1919

2020
Runs on `http://localhost:3000` by default.
2121

22+
## Pre-commit setup
23+
24+
AstrBot uses [pre-commit](https://pre-commit.com/) hooks to automatically format and lint Python code before each commit. The hooks run `ruff check`, `ruff format`, and `pyupgrade` (see [`.pre-commit-config.yaml`](.pre-commit-config.yaml) for details).
25+
26+
To set it up:
27+
28+
```bash
29+
pip install pre-commit
30+
pre-commit install
31+
```
32+
33+
After installation, the hooks will run automatically on `git commit`. You can also run them manually at any time:
34+
35+
```bash
36+
ruff format .
37+
ruff check .
38+
```
39+
40+
> **Note:** If you use VSCode, install the `Ruff` extension for real-time formatting and linting in the editor.
41+
2242
## Dev environment tips
2343

2444
1. When modifying the WebUI, be sure to maintain componentization and clean code. Avoid duplicate code.

0 commit comments

Comments
 (0)