Skip to content

chore(style): fix lint for jinja template #1069

chore(style): fix lint for jinja template

chore(style): fix lint for jinja template #1069

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
paths:
- "src/**"
- "tests/**"
- ".github/**"
- "uv.lock"
- "pyproject.toml"
jobs:
prek:
name: Prek
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: j178/prek-action@v1
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: crate-ci/typos@master
basedpyright:
name: BasedPyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: 3.12
version: "latest"
- name: Install Dependencies
run: uv sync --locked
- name: Static typing check
run: uvx basedpyright
test:
name: Test
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
concurrency:
group: test-others-${{ github.ref }}-${{ matrix.python-version }}-${{ matrix.pydantic }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
pydantic: ["pydantic-v1", "pydantic-v2"]
exclude:
- python-version: "3.14"
pydantic: "pydantic-v1"
env:
OS: ubuntu-latest
TASK: test-other
PYTHON: ${{ matrix.python-version }}
PYDANTIC: ${{ matrix.pydantic }}
UV_NO_SYNC: 1
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ env.PYTHON }}
version: "latest"
- name: Install Dependencies
run: uv sync --locked --group ${{ env.PYDANTIC }}
- name: Run Pytest Others
run: uv run poe ${{ env.TASK }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON,PYDANTIC
use_oidc: true
report_type: "test_results"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON,PYDANTIC
use_oidc: true
test-parsers:
name: Test Parsers
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
concurrency:
group: test-parsers-${{ github.ref }}
cancel-in-progress: true
env:
DENO: v2.x
PYTHON: 3.14
UV_NO_SYNC: 1
TEST: "test-parser"
steps:
- uses: actions/checkout@v6
- name: Setup FFmpeg
uses: AnimMouse/setup-ffmpeg@v1
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: ${{ env.DENO }}
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ env.PYTHON }}
version: "latest"
- name: Install Dependencies
run: uv sync --locked
- name: Run Pytest Parsers
run: uv run poe ${{ env.TEST }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
use_oidc: true
report_type: "test_results"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
use_oidc: true
test-render:
name: Test Render
runs-on: ubuntu-latest
permissions:
id-token: write
issues: write
pull-requests: write
contents: read
concurrency:
group: test-render-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON: 3.14
UV_NO_SYNC: 1
TASK: test-render
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ env.PYTHON }}
version: "latest"
- name: Install Dependencies
run: uv sync --locked
- name: Cache Playwright browsers
uses: actions/cache@v5
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
~/work/nonebot-plugin-parser/nonebot-plugin-parser/data/nonebot_plugin_htmlrender
key: ${{ runner.os }}-playwright-${{ hashFiles('**/uv.lock') }}
restore-keys: ${{ runner.os }}-playwright-
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: uv run playwright install chromium-headless-shell --with-deps
- name: Run Pytest Render
run: uv run poe ${{ env.TASK }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
use_oidc: true
report_type: "test_results"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
use_oidc: true
- name: Find or Create Comment
if: ${{ github.event.pull_request.number && github.event.pull_request.user.login == github.repository_owner }}
uses: peter-evans/find-comment@v4
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
- name: Update Comment
if: ${{ github.event.pull_request.number && github.event.pull_request.user.login == github.repository_owner }}
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: render_result_combined.md
edit-mode: replace