antlr-rust-runtime 0.15.1

High performance Rust runtime and target support for ANTLR v4 generated parsers
Documentation
name: CI

on:
  pull_request:
  push:
    branches:
      - main

permissions:
  contents: read
  pull-requests: write
  issues: write
  # Codecov's tokenless upload authenticates via an OIDC token minted by the
  # workflow, so the job must be allowed to request one.
  id-token: write

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: Clippy and Unit Tests
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v7
        with:
          persist-credentials: false
          fetch-depth: 0

      - name: Install stable Rust
        run: |
          rustup toolchain install stable --profile minimal --component clippy,llvm-tools --no-self-update
          rustup default stable

      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-llvm-cov

      - name: Validate direct-codegen fixtures
        run: node tools/grammar-frontend/validate-interp-fixtures.mjs

      - name: Run Clippy
        run: cargo clippy --locked --all-targets --all-features -- -D warnings

      # `cargo llvm-cov` runs the same suite as `cargo test` but under LLVM
      # source-based instrumentation, so it replaces the plain test step and
      # emits an lcov report in one pass. Line/region coverage only — branch
      # coverage needs the nightly-only `-Z coverage-options=branch`.
      - name: Run unit tests with coverage
        run: cargo llvm-cov --locked --all-features --workspace --lcov --output-path lcov.info

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v7
        with:
          files: lcov.info
          flags: unittests
          use_oidc: true
          # Surface upload problems instead of silently passing, but do not
          # fail the build for external Codecov availability blips.
          fail_ci_if_error: false
          disable_search: true

      - uses: ophi-dev/mehen@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          paths: |
            src