Skip to content

feat: HTML grammar #897

feat: HTML grammar

feat: HTML grammar #897

# Test coverage job. It is run on pull request because it prints the results via comment
name: Parser conformance and comparison
on:
pull_request:
branches:
- main
paths:
- 'crates/biome_js_syntax/**'
- 'crates/biome_js_factory/**'
- 'crates/biome_js_semantic/**'
- 'crates/biome_js_parser/**'
- 'crates/biome_rowan/**'
- 'xtask/**'
env:
RUST_LOG: info
RUST_BACKTRACE: 1
jobs:
coverage:
permissions:
pull-requests: write
name: Parser conformance
runs-on: ubuntu-latest
steps:
- name: Checkout PR Branch
uses: actions/checkout@v4
- name: Support longpaths
run: git config core.longpaths true
- name: Checkout PR Branch
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install toolchain
uses: moonrepo/setup-rust@v1
- name: Compile
run: cargo build --release --locked -p xtask_coverage
- name: Run Test suites
continue-on-error: true
run: cargo coverage --json > new_results.json
- name: Checkout main Branch
uses: actions/checkout@v4
with:
clean: false
ref: main
submodules: recursive
- name: Run Test suites on main branch
continue-on-error: true
run: cargo coverage --json > base_results.json
- name: Compare results on ${{ matrix.os }}
if: github.event_name == 'pull_request'
id: comparison
shell: bash
run: |
echo "## Parser conformance results on ${{ matrix.os }}" > output
cargo coverage compare ./base_results.json ./new_results.json --markdown >> output
cat output
echo "comment<<EOF" >> $GITHUB_OUTPUT
cat output >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Get the PR number
if: github.event_name == 'pull_request'
id: pr-number
uses: kkak10/[email protected]
- name: Find Previous Comment
if: github.event_name == 'pull_request'
uses: peter-evans/[email protected]
id: previous-comment
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body-includes: Parser conformance results on ${{ matrix.os }}
- name: Update existing comment
if: github.event_name == 'pull_request' && steps.previous-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v3
continue-on-error: true
with:
comment-id: ${{ steps.previous-comment.outputs.comment-id }}
body: |
${{ steps.comparison.outputs.comment }}
edit-mode: replace
- name: Write a new comment
if: github.event_name == 'pull_request' && !steps.previous-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v3
continue-on-error: true
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body: |
${{ steps.comparison.outputs.comment }}
- name: Clean cache
run: cargo cache --autoclean