diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..a5817d0 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,65 @@ +name: Coverage + +on: + push: + branches: [main] + paths: + - 'crates/**' + - 'tests/**' + - 'scripts/**' + - 'Cargo.toml' + - 'Cargo.lock' + - 'rust-toolchain.toml' + - '.github/workflows/coverage.yml' + pull_request: + branches: [main] + paths: + - 'crates/**' + - 'tests/**' + - 'scripts/**' + - 'Cargo.toml' + - 'Cargo.lock' + - 'rust-toolchain.toml' + - '.github/workflows/coverage.yml' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: coverage-${{ github.ref }} + cancel-in-progress: true + +jobs: + coverage: + name: Linux line coverage + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.97.1 + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@4076c08d76dba979c11a7285295b0716c1d67908 # v2 + with: + tool: cargo-llvm-cov@0.9.1 + - name: Install official Lua compilers + run: bash scripts/install_ci_compilers.sh + - name: Measure workspace and CLI subprocess coverage + run: bash scripts/coverage.sh "${RUNNER_TEMP}/lcov.info" + - name: Retain coverage report + uses: actions/upload-artifact@v4 + with: + name: linux-coverage + path: ${{ runner.temp }}/lcov.info + if-no-files-found: error + retention-days: 7 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ runner.temp }}/lcov.info + disable_search: true + fail_ci_if_error: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 543392f..9c5cb71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes are documented here. `luad` is a 0.x experimental tool: no dialect is promoted to a supported tier and no interface carries a compatibility promise yet. +## Unreleased + +- Add the project logo and CI, Codecov, release, and dual-license badges to the README. + Publish measured Linux line coverage from the workspace suite and instrumented CLI + subprocesses through a separate coverage workflow. + ## 0.3.0 — 2026-09-18 - Emit closed `prototype` expressions with child prototype paths and physical PC diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71a0000..346065d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,33 @@ update package metadata, CI evidence, release documentation, and the changelog t `scripts/check.sh` runs the aggregate repository checks. It is necessary before handoff, but it is not proof that oracle-backed claims are correct; each work package must also pass its canonical gate. +### Line coverage + +The separate [Coverage workflow](.github/workflows/coverage.yml) runs on hosted Linux +for code, fixture, toolchain, or coverage-workflow changes. It installs the required +official Lua compilers and runs the entire workspace test suite with LLVM +instrumentation, including the CLI subprocesses exercised by integration tests. +It uploads an LCOV report through `codecov/codecov-action@v5`, using the repository's +`CODECOV_TOKEN` Actions secret, and retains a copy as an Actions artifact. Upload +failures fail the coverage job rather than silently leaving stale data. + +For a local report, install the `cargo-llvm-cov` version pinned in that workflow, add +`llvm-tools-preview` to the repository's Rust toolchain with `rustup component add +llvm-tools-preview`, and run: + +```console +bash scripts/coverage.sh +``` + +The report is `artifacts/coverage/lcov.info`. It includes the CLI and libraries; +the `luad-oracle` tooling crate and cargo-llvm-cov's default test/dependency exclusions +are omitted from the report, while their tests still run. The badge measures Linux +line coverage, not branch coverage, semantic correctness, or supported-target status. +Containment tests deliberately terminate child processes, so some coverage writes can +be incomplete. Report merging warns about invalid profiles and retains the valid ones; +it fails if none can be merged. Counters from interrupted processes may be absent. +Coverage tooling is optional for contributors and does not change `scripts/check.sh`. + Dependency changes must also pass the pinned `cargo-deny` policy: ```console diff --git a/README.md b/README.md index 873c6ee..a94f4df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,17 @@ -# `luad` +
+
+
+
+