a3s-sandbox 0.1.2

Cross-platform native command sandbox for A3S
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read

jobs:
  check:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-14, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - name: Prepare Linux sandbox host
        if: runner.os == 'Linux'
        shell: bash
        run: |
          sudo apt-get update
          sudo apt-get install --yes bubblewrap
          if sysctl -N kernel.apparmor_restrict_unprivileged_userns >/dev/null 2>&1; then
            sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
          fi
          if sysctl -N kernel.unprivileged_userns_clone >/dev/null 2>&1; then
            sudo sysctl -w kernel.unprivileged_userns_clone=1
          fi
      - run: cargo fmt --all -- --check
      - run: cargo clippy --all-targets -- -D warnings
      - name: Run tests
        if: runner.os != 'Windows'
        run: cargo test --all-targets
      - name: Run Windows tests with bounded diagnostics
        if: runner.os == 'Windows'
        timeout-minutes: 10
        run: cargo test --all-targets -- --test-threads=1 --nocapture