Skip to content

Commit a2f9660

Browse files
committed
Update Workflows
1 parent 62bdf17 commit a2f9660

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This is a workflow for building the kasa_cli executable on all three major platforms.
2+
3+
name: Build-All-Platforms
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the "main" branch
8+
push:
9+
branches: ["main"]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
strategy:
17+
matrix:
18+
os: [macos-latest, ubuntu-latest, windows-latest]
19+
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- name: Check-out repository
24+
uses: actions/checkout@v3
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
30+
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
31+
cache: 'pip'
32+
cache-dependency-path: |
33+
**/requirements*.txt
34+
35+
- name: Install Dependencies
36+
run: |
37+
pip install -r requirements.txt
38+
39+
- name: Build Executable
40+
uses: Nuitka/Nuitka-Action@main
41+
with:
42+
nuitka-version: main
43+
script-name: main.py
44+
onefile: true
45+
standalone: true
46+
disable-console: true
47+
windows-icon-from-ico: ./asset/spicon.ico
48+
49+
- name: Upload Artifacts
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: ${{ runner.os }} Build
53+
path: |
54+
build/*.exe
55+
build/*.bin
56+
build/*.app/**/*

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
18+
runs-on: [macos-latest, ubuntu-latest, windows-latest]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python 3.10
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: "3.10"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Test with pytest
38+
run: |
39+
pytest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ___注:`Windows-Toasts` 库只能在 Windows 下生效!___
2727

2828
- [x] 基本逻辑
2929
- [x] 吐司通知 (Windows 独占性功能)
30+
- [x] GitHub Actions 自动测试编译工作流 (使用 __Nuitka____Pytest__ 实现)
3031
- [ ] 设置 (目前已有占位按钮 `settings_btn`)
3132
- [ ] 歌词显示与滚动 (已预留了歌词路径变量 `lyricFile` 和读取函数 `lyricExistAndRead`)
3233
- [ ] 歌单 (目前已有占位按钮 `audioList_btn`)
@@ -36,7 +37,6 @@ ___注:`Windows-Toasts` 库只能在 Windows 下生效!___
3637
- [ ] 界面自动取色
3738
- [ ] 混音器
3839
- [ ] 在线获取歌曲 (__网易云__) (目前已有占位菜单按钮)
39-
- [ ] GitHub Actions 自动编译工作流 (使用 __Nuitka__ 实现)
4040

4141
## BUG 列表
4242

0 commit comments

Comments
 (0)