rsconstruct 0.9.42

Rust based fast build system
name: Test

on:
  push:
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: true

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo registry and target
        uses: Swatinem/rust-cache@v2

      - name: Build
        run: cargo build

      # These three steps configure package-manager *destinations* only. They
      # deliberately install no tools: naming a tool here would duplicate the
      # registry, and a tool named in a workflow is a tool that silently
      # diverges from what rsconstruct actually needs. Every tool comes from
      # the single `tools install --all` step below.
      #
      # pip installs into the system interpreter are rejected on modern
      # Ubuntu (PEP 668); pip-based tools go into this venv instead.
      - name: Set up Python venv as the pip destination
        run: |
          python3 -m venv "$HOME/.venv"
          echo "$HOME/.venv/bin" >> "$GITHUB_PATH"

      # The runner's system gem directory is root-owned; give gem installs
      # a user-writable home.
      - name: Set up user gem home as the gem destination
        run: |
          echo "GEM_HOME=$HOME/.gem" >> "$GITHUB_ENV"
          echo "$HOME/.gem/bin" >> "$GITHUB_PATH"

      # Some npm packages (jslint) symlink man pages into root-owned
      # /usr/local/share; route npm -g installs to a user-writable prefix.
      - name: Set up user npm prefix as the npm destination
        run: |
          npm config set prefix "$HOME/.npm-global"
          echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"

      # The whole tool matrix, in one registry-driven command. rsconstruct is
      # the only thing this workflow installs by name (via `cargo build`
      # above); every external tool comes from its own registry, so adding a
      # processor never requires touching this file.
      #
      # Nothing is skipped and nothing is filtered here — `--all` treats a
      # tool it cannot install automatically as a hard error rather than a
      # warning, so a registry entry that loses its install method fails this
      # step instead of quietly shrinking the matrix and surfacing later as a
      # confusing test failure.
      - name: Install all registry tools
        run: ./target/debug/rsconstruct tools install -y --all

      # The suite hard-fails on any missing tool (tests never skip), so a
      # gap in the matrix fails the run loudly instead of shrinking it.
      - name: Run tests
        run: cargo test