Skip to content

chore(deps): update dependency node to v24 #501

chore(deps): update dependency node to v24

chore(deps): update dependency node to v24 #501

Workflow file for this run

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@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.5"
- 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@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.5"
- 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@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.5"
- uses: actions/setup-node@v6
with:
node-version: 24
- 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