fix: rbac保存错误 #20
This file contains hidden or 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
| name: 预构建检查 | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| pull_request: | |
| jobs: | |
| pre_build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.13"] # 最新稳定版 | |
| steps: | |
| # 1. 检出源码(官方最新 v4) | |
| - name: 检出源码 | |
| uses: actions/checkout@v6 | |
| # 2. 安装 Python 3.13(官方最新 v5) | |
| - name: 安装 Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # 3. 缓存 pip 依赖 | |
| - name: 缓存 pip | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| # 4. 缓存 pre-commit 环境 | |
| - name: 缓存 pre-commit | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| # 5. 安装运行时依赖 + 测试/构建工具 | |
| - name: 安装依赖 | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest pre-commit build twine | |
| # 6. 运行 pre-commit | |
| - name: 运行 pre-commit | |
| run: pre-commit run --all-files --show-diff-on-failure | |
| # 7. 运行 pytest | |
| - name: 运行 pytest | |
| run: pytest -q |