sboxd 0.1.9

Policy-driven command runner for sandboxed dependency installation
Documentation
name: CI

on:
  push:
    branches: ["master"]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4

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

      - name: Cache
        uses: Swatinem/rust-cache@v2

      - name: Build
        run: cargo build

      - name: Unit tests
        run: cargo test --lib

      - name: Integration tests (no container runtime required)
        # Windows: skip integration tests that rely on Unix test helpers
        if: matrix.os != 'windows-latest'
        run: cargo test --tests --exclude-ignored
        env:
          SBOX_RUN_PODMAN_TESTS: ""
          SBOX_RUN_DOCKER_TESTS: ""

      - name: Integration tests (Windows smoke)
        # Run the subset of integration tests that are pure Rust with no Unix deps.
        if: matrix.os == 'windows-latest'
        run: cargo test --test cli_tests --test resolve_tests --test plan_golden_tests

  test-docker:
    name: Docker integration tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

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

      - name: Cache
        uses: Swatinem/rust-cache@v2

      - name: Build
        run: cargo build

      - name: Pull images (warm cache)
        run: |
          docker pull python:3.13-slim &
          docker pull node:22-bookworm-slim &
          wait

      - name: Docker integration tests
        run: cargo test --test docker_integration_tests
        env:
          SBOX_RUN_DOCKER_TESTS: "1"

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt

      - name: Cache
        uses: Swatinem/rust-cache@v2

      - name: fmt
        run: cargo fmt --check

      - name: clippy
        run: cargo clippy -- -D warnings