doc: 更新目录形式 #21
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: Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '18' | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| npm install | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install -r requirements.txt | |
| - name: Build package | |
| run: | | |
| npm run build | |
| python -m build | |
| - name: Install browser for testing | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y chromium-browser chromium-chromedriver xvfb | |
| - name: Start virtual display | |
| run: | | |
| export DISPLAY=:99 | |
| Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
| - name: Run tests | |
| run: | | |
| pip install -e . | |
| python -m pytest tests/ -v | |
| env: | |
| DISPLAY: :99 | |
| lint-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '18' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| npm install | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Run lint check | |
| run: | | |
| npx eslint src/**/*.js src/**/*.react.js | |
| python -m ruff check . --exclude=node_modules,venv,build | |
| - name: Run format check | |
| run: | | |
| npx prettier --check src/**/*.js src/**/*.react.js | |
| python -m ruff format . --check --exclude=node_modules,venv,build |