chore(deps): update dependency astral-sh/uv to v0.12.9 #519
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 package and web app | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| lint: | |
| name: Pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.14" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| version: "0.12.9" | |
| - name: Run pre-commit hooks | |
| run: uvx pre-commit run --all-files | |
| test: | |
| strategy: | |
| matrix: | |
| python: ["3.10", "3.13"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| version: "0.12.9" | |
| - name: Install dependencies | |
| run: uv pip install --system nox[uv] | |
| - name: Test with pytest | |
| run: nox -db uv | |
| - name: Upload Python coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| use_oidc: true | |
| flags: python | |
| name: python-${{ matrix.python }} | |
| web: | |
| name: Web tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.14" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| version: "0.12.9" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Install web test dependencies | |
| run: npm install | |
| - name: Run web unit tests with coverage | |
| run: npm run test:web | |
| - name: Upload web coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| use_oidc: true | |
| files: ./coverage/lcov.info | |
| flags: web | |
| name: web | |
| fail_ci_if_error: true | |
| - name: Build test web bundle from locked dependencies | |
| run: | | |
| uv build --wheel | |
| wheel=$(echo dist/wenxian-*.whl) | |
| python scripts/build_web_bundle.py "$wheel" test-web-bundle.tar.gz | |
| bundle_bytes=$(stat -c%s test-web-bundle.tar.gz) | |
| echo "Web bundle: $bundle_bytes bytes" | |
| test "$bundle_bytes" -lt 1000000 | |
| - name: Install Chromium | |
| run: npx playwright install --with-deps chromium | |
| - name: Run browser end-to-end smoke test | |
| env: | |
| WENXIAN_WEB_BUNDLE_PATH: ${{ github.workspace }}/test-web-bundle.tar.gz | |
| run: | | |
| python3 -m http.server 8000 --directory docs >/tmp/wenxian-web.log 2>&1 & | |
| server_pid=$! | |
| trap 'kill "$server_pid"' EXIT | |
| for _ in {1..20}; do | |
| if curl --fail --silent http://127.0.0.1:8000/ >/dev/null; then | |
| break | |
| fi | |
| sleep 0.25 | |
| done | |
| npm run test:web:e2e | |
| - name: Upload browser failure screenshot | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: web-e2e-failure | |
| path: web-e2e-failure.png | |
| if-no-files-found: ignore | |
| pass: | |
| name: Pass testing | |
| needs: [lint, test, web] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| permissions: | |
| contents: read | |
| id-token: write |