refactor: 完成所有测试用例描述的中文化改造 (111/111) #234
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: Sync Test Cases | |
| on: | |
| # 低频定时同步(每天一次,作为兜底) | |
| schedule: | |
| - cron: '0 */6 * * *' # 每6小时执行一次 | |
| # 主要触发方式:代码推送(测试文件或同步脚本有变更时触发) | |
| push: | |
| branches: [main, master] | |
| paths: | |
| - 'examples/**' | |
| - 'tests/**' | |
| - 'test_cases/**' | |
| - 'scripts/sync_cases.py' | |
| - '.github/workflows/sync-cases.yml' | |
| # 手动触发 | |
| workflow_dispatch: | |
| inputs: | |
| force_sync: | |
| description: '强制同步所有用例' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install pymysql | |
| - name: Parse and Sync Cases | |
| env: | |
| DB_HOST: ${{ secrets.DB_HOST }} | |
| DB_PORT: ${{ secrets.DB_PORT }} | |
| DB_USER: ${{ secrets.DB_USER }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| DB_NAME: ${{ secrets.DB_NAME }} | |
| FORCE_SYNC: ${{ github.event.inputs.force_sync }} | |
| TRIGGER_TYPE: ${{ github.event_name }} | |
| GIT_BASE_SHA: ${{ github.event.before }} | |
| GIT_HEAD_SHA: ${{ github.sha }} | |
| TEST_DIR: examples | |
| run: python scripts/sync_cases.py |