docs: give 0.8.0 upgrade notes and restore the merged-cell output not… #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Run JavaScript actions on Node.js 24. Opt-in flag documented in | |
| # https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ | |
| # Forced default on 2026-06-02; remove this line after that date. | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| version-check: | |
| name: Version Consistency | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify all package versions match | |
| shell: bash | |
| run: | | |
| # Extract version strings from the canonical version-bearing files. | |
| # CI fails fast when any are out of sync — a full release can't ship | |
| # mismatched versions. | |
| root=$(grep -m1 '^version = ' Cargo.toml | sed 's/.*"\(.*\)".*/\1/') | |
| cli=$(grep -m1 '^version = ' cli/Cargo.toml | sed 's/.*"\(.*\)".*/\1/') | |
| wasm=$(grep -m1 '^version = ' undoc-wasm/Cargo.toml | sed 's/.*"\(.*\)".*/\1/') | |
| py=$(grep -m1 '^version = ' bindings/python/pyproject.toml | sed 's/.*"\(.*\)".*/\1/') | |
| cs=$(grep -oE '<Version>[^<]+</Version>' bindings/csharp/Undoc/Undoc.csproj | head -1 | sed 's/<[^>]*>//g') | |
| # The Python package also reports its own version at runtime via | |
| # undoc.__version__, so it has to agree too — it is what consumers see. | |
| pyinit=$(grep -m1 '^__version__ = ' bindings/python/src/undoc/__init__.py | sed 's/.*"\(.*\)".*/\1/') | |
| # Also verify cli/Cargo.toml's undoc dep points at the same version | |
| # so consumers of the published crate aren't broken. | |
| dep=$(grep -m1 'undoc = { version =' cli/Cargo.toml | sed 's/.*version = "\([^"]*\)".*/\1/') | |
| echo "Root Cargo.toml: $root" | |
| echo "cli/Cargo.toml: $cli" | |
| echo "undoc-wasm/Cargo.toml: $wasm" | |
| echo "bindings/python/pyproject.toml: $py" | |
| echo "bindings/csharp/Undoc/Undoc.csproj: $cs" | |
| echo "bindings/python/src/undoc/__init__.py: $pyinit" | |
| echo "cli -> undoc dep version: $dep" | |
| fail=0 | |
| for v in "$cli" "$wasm" "$py" "$cs" "$pyinit" "$dep"; do | |
| if [ "$v" != "$root" ]; then | |
| fail=1 | |
| fi | |
| done | |
| if [ $fail -eq 1 ]; then | |
| echo "::error::Version mismatch — update every canonical version file (including bindings/python/src/undoc/__init__.py) AND cli's undoc dep together." | |
| exit 1 | |
| fi | |
| echo "All versions match: $root" | |
| test: | |
| name: Test | |
| needs: version-check | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| rust: [stable] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Build | |
| run: cargo build --release | |
| - name: Run tests | |
| # --workspace: without it only the root package is tested, so the cli and | |
| # wasm crates' own tests never run. | |
| run: cargo test --workspace | |
| - name: Build with FFI | |
| run: cargo build --release --features ffi | |
| build-wasm: | |
| name: Build WASM | |
| needs: version-check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: ${{ runner.os }}-cargo-wasm-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-wasm- | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Build WASM (bundler target) | |
| run: wasm-pack build undoc-wasm --target bundler | |
| - name: Run wasm-pack tests (Node.js) | |
| run: wasm-pack test --node undoc-wasm | |
| lint: | |
| name: Lint | |
| needs: version-check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy -- -D warnings | |
| security-audit: | |
| name: Security Audit | |
| needs: version-check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Prebuilt binary — avoids compiling cargo-audit on every run. | |
| - name: Install cargo-audit | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-audit | |
| # Fails on any vulnerability not listed in .cargo/audit.toml. Accepted | |
| # advisories (transitive, unreachable) are documented there with the | |
| # reasoning, so this gate stays green until a NEW advisory appears. | |
| # Informational warnings (unmaintained/unsound) are reported, not fatal. | |
| - name: Audit dependencies | |
| run: cargo audit |