b4e407e9d1256419268439bf7ad2f08ddf3227fe
python-action-test
这是一个简单的 Python 项目示例,包含一个 Gitea Actions 工作流。
说明
main.py包含一个简单的main()函数,用于打印欢迎消息。tests/test_main.py提供一个最小单元测试,检查main()是否输出预期文本。.gitea/workflows/python-action-test.yml是 Gitea Actions 的工作流配置,用于在push和pull_request事件时运行测试。
本地运行
python main.py
python -m pip install pytest
pytest
Gitea Actions
将此仓库推送到 Gitea 后,Gitea Actions 会触发以下流程:
- 检出仓库代码
- 安装 Python 3.14
- 安装
pytest - 执行单元测试
工作流文件路径:.gitea/workflows/python-action-test.yml
Description
Languages
Python
100%