Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

release: 13.0.0

release: 13.0.0 #3430

# 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/rome_js_syntax/**'
- 'crates/rome_js_factory/**'
- 'crates/rome_js_parser/**'
- 'crates/rome_rowan/**'
- 'xtask/**'
env:
RUST_LOG: info
RUST_BACKTRACE: 1
jobs:
coverage:
name: Parser conformance
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: false
- name: Support longpaths
run: git config core.longpaths true
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install toolchain
uses: moonrepo/setup-rust@v0
- 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@v3
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/pr-number-action@v1.3
- name: Find Previous Comment
if: github.event_name == 'pull_request'
uses: peter-evans/find-comment@v1.3.0
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@v1.4.5
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@v1.4.5
continue-on-error: true
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body: |
${{ steps.comparison.outputs.comment }}
- name: Clean cache
run: cargo cache --autoclean