-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86cb5d1
commit 459f000
Showing
82 changed files
with
6,478 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: Custom issue template | ||
about: Describe this issue template's purpose here. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- 'Feature' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- 'hotfix' | ||
- title: '🧰 Maintenance' | ||
labels: | ||
- 'chore' | ||
- 'maintenance' | ||
- 'refactor' | ||
- 'style' | ||
- 'docs' | ||
exclude-labels: | ||
- 'skip-changelog' | ||
- 'duplicate' | ||
- 'question' | ||
- 'invalid' | ||
- 'wontfix' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## What's Changed | ||
$CHANGES | ||
## Contributors | ||
Thanks to all the contributors who have helped with this release! | ||
$CONTRIBUTORS |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Python Unittest Coverage | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
if: false == contains(github.event.pull_request.title, 'WIP') | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ['3.9'] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: '3.9' | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@master | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
pip install -q -e .[full] | ||
pip install coverage | ||
- name: Run tests with coverage | ||
run: | | ||
coverage run tests/run.py | ||
- name: Generate coverage report | ||
run: | | ||
coverage report -m |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,3 +138,4 @@ docs/sphinx_doc/build/ | |
|
||
# Used to save loggings and files | ||
runs/ | ||
examples/game/checkpoints/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import os | ||
import requests | ||
import shutil | ||
import zipfile | ||
from io import BytesIO | ||
|
||
config_url = os.environ.get("CONFIG_URL", None) | ||
game_name = os.environ.get("GAME_NAME", "自定义游戏") | ||
|
||
if config_url: | ||
try: | ||
response = requests.get(config_url) | ||
if response.status_code == 200: | ||
zipfile_obj = zipfile.ZipFile(BytesIO(response.content)) | ||
os.makedirs('user_config', exist_ok=True) | ||
zipfile_obj.extractall(path='user_config') | ||
|
||
# 遍历user_config文件夹中的所有文件和文件夹 | ||
for item in os.listdir('user_config'): | ||
source_item_path = os.path.join('user_config', item) | ||
|
||
# 检查是文件还是文件夹 | ||
if os.path.isfile(source_item_path): | ||
# 如果是.yaml文件,将其复制到config文件夹下 | ||
if item.endswith('.yaml'): | ||
os.makedirs('config', exist_ok=True) | ||
shutil.copy(source_item_path, os.path.join('config', item)) | ||
elif os.path.isdir(source_item_path): | ||
# 如果是文件夹,将整个文件夹复制到assets文件夹下 | ||
os.makedirs('assets', exist_ok=True) | ||
destination_folder_path = os.path.join('assets', item) | ||
shutil.copytree(source_item_path, destination_folder_path) | ||
|
||
else: | ||
print(f"下载失败,HTTP 状态码: {response.status_code}") | ||
except Exception as e: | ||
print(f"发生错误: {e}") | ||
|
||
os.system("rm -rf /tmp/as_game") | ||
# 运行游戏应用程序 | ||
os.system(f"python game_app.py -toc --name {game_name}") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.