Skip to content

Topic9:DSL错误提示美化器设计文档和开发文档 #1

Topic9:DSL错误提示美化器设计文档和开发文档

Topic9:DSL错误提示美化器设计文档和开发文档 #1

Workflow file for this run

name: DSL Diagnostics CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
inputs:
baseline_ref:
description: Baseline commit or branch for a manual comparison
type: string
default: main
required: true
permissions:
contents: read
concurrency:
group: dsl-diagnostics-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Topic 9 tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout event commit
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"
- name: Install DSL test dependencies
run: python -m pip install -e . "pytest>=7,<10"
- name: Run DSL diagnostics and parser regressions
run: |
mkdir -p benchmark_reports
python -m pytest \
tests/test_dsl_errors.py \
tests/test_dsl_validator.py \
tests/test_dsl_diagnostics_cli.py \
tests/test_parser.py \
tests/test_dsl_extended.py \
tests/test_dsl_diagnostics_benchmark.py \
-v --tb=short \
--junit-xml=benchmark_reports/dsl_test_results.xml
- name: Upload DSL test results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dsl-test-reports
path: benchmark_reports/dsl_test_results.xml
retention-days: 30
benchmark:
name: Topic 9 benchmark
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout event commit
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
path: current
persist-credentials: false
- name: Resolve baseline revision
id: baseline
env:
BASE_REF: ${{ github.event.pull_request.base.sha || inputs.baseline_ref || github.event.before }}
run: |
if [ -z "$BASE_REF" ] || [ "$BASE_REF" = "0000000000000000000000000000000000000000" ]; then
echo "::error::No baseline revision; run manually with baseline_ref."
exit 1
fi
echo "ref=$BASE_REF" >> "$GITHUB_OUTPUT"
- name: Checkout baseline
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: ${{ steps.baseline.outputs.ref }}
path: baseline
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"
- name: Install shared parser dependencies
working-directory: current
run: python -m pip install -e .
- name: Run DSL diagnostics and parser benchmark
working-directory: current
run: |
python -m benchmarks.bench_dsl_diagnostics \
--baseline-root ../baseline \
--json-output benchmark_reports/dsl_diagnostics.json \
--markdown benchmark_reports/dsl_diagnostics.md \
--html benchmark_reports/dsl_diagnostics.html
- name: Write DSL benchmark summary
if: always()
run: |
REPORT=current/benchmark_reports/dsl_diagnostics.md
if [ -f "$REPORT" ]; then
cat "$REPORT" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload DSL benchmark reports
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dsl-benchmark-reports
path: current/benchmark_reports/dsl_diagnostics.*
retention-days: 30