Skip to content

Commit

Permalink
Merge pull request ArkMowers#673 from ArkMowers/dev_shawn
Browse files Browse the repository at this point in the history
Dev shawn
  • Loading branch information
Ks-luow authored Sep 6, 2024
2 parents 6415b80 + 1ea4cb5 commit ca368a4
Show file tree
Hide file tree
Showing 2,348 changed files with 63,550 additions and 9,877 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/format-check-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://arkmowers.github.io/arknights-mower/dev/environment.html#auto-formatting

name: 代码格式检查与测试
on:
- push
- pull_request

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: "format --check"

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: creyD/[email protected]
with:
dry: True
prettier_options: "--check ui/**/*.js ui/**/*.vue"

unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: requirements.txt
- run: |
python3.12 -m venv venv
./venv/bin/pip install -r requirements.txt
- run: |
./venv/bin/python3 -m unittest discover -s arknights_mower/tests -p "*_tests.py"
40 changes: 40 additions & 0 deletions .github/workflows/pyinstaller-win-shawn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://arkmowers.github.io/arknights-mower/dev/environment.html#auto-formatting

name: 代码格式检查与测试
on:
- push
- pull_request

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: "format --check"

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: creyD/[email protected]
with:
dry: True
prettier_options: "--check ui/**/*.js ui/**/*.vue"

unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: requirements.txt
- run: |
python3.12 -m venv venv
./venv/bin/pip install -r requirements.txt
- run: |
./venv/bin/python3 -m unittest discover -s arknights_mower/tests -p "*_tests.py"
47 changes: 0 additions & 47 deletions .github/workflows/pyinstaller-win.yml

This file was deleted.

36 changes: 35 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FZDYSK.TTF

!main.spec
*.yaml
!arknights_mower/templates/*.yaml
Expand Down Expand Up @@ -28,11 +30,15 @@ __pycache__/
*.py[cod]
*$py.class

# Nodejs Version Manager
.nvmrc

# C extensions
*.so

# Distribution / packaging
.Python
mower/
build/
develop-eggs/
dist/
Expand All @@ -56,7 +62,6 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -109,6 +114,13 @@ ipython_config.py
# pyenv
.python-version

# nodenv
.node-version

# syncthing
.stfolder/
.stignore

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down Expand Up @@ -175,4 +187,26 @@ dmypy.json
###JetBrains Product###
.idea/*

### 命令行运行产生的/tmp/data.db
/tmp/

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
/*.json
dist
MAA
/*.yml

# venv
/bin/
/pyvenv.cfg
/lib64

#testspace
/testspace


/.buildozer/


*.ipynb
.rgignore
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ArknightsGameResource"]
path = ArknightsGameResource
url = https://github.com/yuanyan3060/ArknightsGameResource
1 change: 1 addition & 0 deletions ArknightsGameResource
Submodule ArknightsGameResource added at 9826fc
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM ubuntu:22.04 AS ubuntu-base

# 设置环境变量以避免tzdata的交互式提示
ENV DEBIAN_FRONTEND noninteractive

# 安装必要的系统库
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.8 python3.8-venv python3.8-tk python3.8-dev python3-pip \
build-essential libgirepository1.0-dev gcc libcairo2-dev pkg-config libzbar0 adb git \
libgtk-3-dev gir1.2-webkit2-4.1 gir1.2-appindicator3-0.1 gobject-introspection tk8.6 \
xvfb \
dbus \
&& rm -rf /var/lib/apt/lists/*



# 使用官方Node.js 18镜像作为基础镜像构建前端
FROM node:18 AS node-base
WORKDIR /app/ui

# 安装前端依赖并构建
COPY ui/package*.json ./
COPY ui/. .
RUN npm ci
RUN npm run build --no-update-notifier



# 合并阶段,使用Python环境为基础,将构建好的前端加入
FROM ubuntu-base AS final
WORKDIR /app
COPY --from=node-base /app/ui/dist ./ui/dist
COPY . .


# 设置Python虚拟环境并安装依赖
RUN python3.8 -m venv venv

RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

RUN . venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt && pip install pycairo PyGObject

# 运行应用
ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"]
Binary file removed FontPruner/SourceHanSansSC-Bold.ttf
Binary file not shown.
Binary file removed FontPruner/sfnttool.jar
Binary file not shown.
Loading

0 comments on commit ca368a4

Please sign in to comment.