# 注意:本工作流只在 GitHub Actions 上执行。 # 本仓托管在 Gitee,此文件不会自动运行——真正的提交门禁是本地 pre-commit # (见 .pre-commit-config.yaml 的 sapcli-unit-tests)。若将来迁到 GitHub, # 此文件即可直接生效。 name: CI on: push: branches: [ main, master ] pull_request: branches: [ main, master ] jobs: test: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # 工具源码与 pyproject 位于 assets/(本仓同时是技能包与工具源码仓) - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e "./assets[dev]" - name: Run tests run: python -m unittest discover -s tests -p "test_*.py" -v - name: Coverage check run: | pip install coverage coverage run -m unittest discover -s tests -p "test_*.py" coverage report --include="assets/sapcli/*" --fail-under=70