Skip to content

Commit 35e3b5d

Browse files
committed
add .github
1 parent 0abdd6f commit 35e3b5d

9 files changed

+193
-4
lines changed

.github/ISSUE_TEMPLATE/config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: "📑 Read online docs"
4+
about: Find tutorials, use cases, and guides in the OpenManus documentation.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: "🤔 Request new features"
3+
about: Suggest ideas or features you’d like to see implemented in OpenManus.
4+
title: ''
5+
labels: kind/features
6+
assignees: ''
7+
---
8+
9+
**Feature description**
10+
<!-- Provide a clear and concise description of the proposed feature -->
11+
12+
**Your Feature**
13+
<!-- Explain your idea or implementation process. Optionally, include a Pull Request URL. -->
14+
<!-- Ensure accompanying docs/tests/examples are provided for review. -->
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: "🪲 Show me the Bug"
3+
about: Report a bug encountered while using OpenManus and seek assistance.
4+
title: ''
5+
labels: kind/bug
6+
assignees: ''
7+
---
8+
9+
**Bug description**
10+
<!-- Clearly describe the bug you encountered -->
11+
12+
**Bug solved method**
13+
<!-- If resolved, explain the solution. Optionally, include a Pull Request URL. -->
14+
<!-- If unresolved, provide additional details to aid investigation -->
15+
16+
**Environment information**
17+
<!-- System: e.g., Ubuntu 22.04, Python: e.g., 3.12, OpenManus version: e.g., 0.1.0 -->
18+
19+
- System version:
20+
- Python version:
21+
- OpenManus version or branch:
22+
- Installation method (e.g., `pip install -r requirements.txt` or `pip install -e .`):
23+
24+
**Screenshots or logs**
25+
<!-- Attach screenshots or logs to help diagnose the issue -->

.github/PULL_REQUEST_TEMPLATE.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**Features**
2+
<!-- Describe the features or bug fixes in this PR. For bug fixes, link to the issue. -->
3+
4+
- Feature 1
5+
- Feature 2
6+
7+
**Feature Docs**
8+
<!-- Provide RFC, tutorial, or use case links for significant updates. Optional for minor changes. -->
9+
10+
**Influence**
11+
<!-- Explain the impact of these changes for reviewer focus. -->
12+
13+
**Result**
14+
<!-- Include screenshots or logs of unit tests or running results. -->
15+
16+
**Other**
17+
<!-- Additional notes about this PR. -->

.github/workflows/build-package.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and upload Python package
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created, published]
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.12'
17+
cache: 'pip'
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -r requirements.txt
22+
pip install setuptools wheel twine
23+
- name: Set package version
24+
run: |
25+
export VERSION="${GITHUB_REF#refs/tags/v}"
26+
sed -i "s/version=.*/version=\"${VERSION}\",/" setup.py
27+
- name: Build and publish
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31+
run: |
32+
python setup.py bdist_wheel sdist
33+
twine upload dist/*

.github/workflows/pre-commit.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pre-commit checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
push:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
pre-commit-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Source Code
16+
uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
- name: Install pre-commit and tools
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pre-commit black==23.1.0 isort==5.12.0 autoflake==2.0.1
25+
- name: Run pre-commit hooks
26+
run: pre-commit run --all-files

.github/workflows/stale.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close inactive issues
2+
3+
on:
4+
schedule:
5+
- cron: "5 0 * * *"
6+
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/stale@v5
15+
with:
16+
days-before-issue-stale: 30
17+
days-before-issue-close: 14
18+
stale-issue-label: "inactive"
19+
stale-issue-message: "This issue has been inactive for 30 days. Please comment if you have updates."
20+
close-issue-message: "This issue was closed due to 45 days of inactivity. Reopen if still relevant."
21+
days-before-pr-stale: -1
22+
days-before-pr-close: -1
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/unittest.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request_target:
5+
push:
6+
branches:
7+
- 'main'
8+
- 'dev'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.12']
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: 'pip'
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
pip install pytest
30+
- name: Run tests with pytest
31+
run: |
32+
pytest app/ | tee unittest.txt
33+
- name: Show failed tests and summary
34+
run: |
35+
grep -E "FAILED|ERROR|[0-9]+ passed," unittest.txt
36+
failed_count=$(grep -E "FAILED|ERROR" unittest.txt | wc -l)
37+
if [[ "$failed_count" -gt 0 ]]; then
38+
echo "$failed_count failed tests found! Task failed."
39+
exit 1
40+
fi
41+
- name: Upload test results
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: pytest-results-${{ matrix.python-version }}
45+
path: ./unittest.txt
46+
retention-days: 3
47+
if: ${{ always() }}

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ repos:
1818
- id: autoflake
1919
args: [
2020
--remove-all-unused-imports,
21-
--ignore-init-module-imports, # 忽略 __init__.py 中的导入
21+
--ignore-init-module-imports,
2222
--expand-star-imports,
2323
--remove-duplicate-keys,
2424
--remove-unused-variables,
2525
--recursive,
2626
--in-place,
27-
--exclude=__init__.py, # 排除 __init__.py 文件
27+
--exclude=__init__.py,
2828
]
29-
files: \.py$ # 只处理 Python 文件
29+
files: \.py$
3030

3131
- repo: https://github.com/pycqa/isort
3232
rev: 5.12.0
3333
hooks:
3434
- id: isort
3535
args: [
36-
"--profile", "black", # 使用 black 兼容的配置
36+
"--profile", "black",
3737
"--filter-files",
3838
"--lines-after-imports=2",
3939
]

0 commit comments

Comments
 (0)