test: 适配 Review 2 修改后的共享 session 行为 #371
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: Pre-commit Checks | |
| on: [push, pull_request] | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| env: | |
| OS: ubuntu-latest | |
| PYTHON: '3.8' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - name: Update setuptools and wheel | |
| run: | | |
| pip install setuptools==68.2.2 wheel==0.41.2 | |
| - name: Install dashscope python sdk | |
| run: | | |
| pip install -r requirements.txt | |
| pip install -r requirements-test.txt | |
| - name: Install pre-commit hooks | |
| run: | | |
| pre-commit install | |
| - name: Run pre-commit | |
| run: | | |
| pre-commit run --all-files > pre-commit.log 2>&1 || true | |
| cat pre-commit.log | |
| if grep -q Failed pre-commit.log; then | |
| echo -e "\e[41m [**FAIL**] Please install pre-commit and format your code first. \e[0m" | |
| exit 1 | |
| fi | |
| echo -e "\e[46m ********************************Passed******************************** \e[0m" |