Skip to content

Remove the repl_reset tool #748

Remove the repl_reset tool

Remove the repl_reset tool #748

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
checks:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
asset_name: mcp-repl-x86_64-unknown-linux-gnu.tar.gz
artifact_name: release-x86_64-unknown-linux-gnu
manylinux: "2014"
- os: macos-15
target: aarch64-apple-darwin
asset_name: mcp-repl-aarch64-apple-darwin.tar.gz
artifact_name: release-aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
asset_name: mcp-repl-x86_64-pc-windows-msvc.zip
artifact_name: release-x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v5
- name: Set up Rust (stable)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt
rustflags: ""
cache-bin: false
- name: Install nightly rustfmt
run: rustup toolchain install nightly --profile minimal --component rustfmt
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up R
if: matrix.os != 'windows-2022'
uses: r-lib/actions/setup-r@v2
- name: Set up R (windows)
if: matrix.os == 'windows-2022'
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.5.3"
- name: Install Linux sandbox dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y bubblewrap
if sysctl kernel.unprivileged_userns_clone >/dev/null 2>&1; then
sudo sysctl -w kernel.unprivileged_userns_clone=1
fi
if sysctl user.max_user_namespaces >/dev/null 2>&1; then
sudo sysctl -w user.max_user_namespaces=28633
fi
if sysctl kernel.apparmor_restrict_unprivileged_userns >/dev/null 2>&1; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
bwrap --version
bwrap --die-with-parent --new-session --unshare-user --unshare-pid \
--ro-bind / / -- /usr/bin/true
- name: cargo check
run: cargo check
- name: cargo build
run: cargo build
- name: Windows sandbox setup
if: matrix.os == 'windows-2022'
shell: pwsh
run: .\target\debug\mcp-repl.exe windows-sandbox setup
- name: Python public API suite
if: matrix.os != 'windows-2022'
run: python3 tests/run_integration_tests.py --binary target/debug/mcp-repl
- name: Python public API suite (windows)
if: matrix.os == 'windows-2022'
shell: pwsh
run: python tests/run_integration_tests.py --binary target/debug/mcp-repl.exe
- name: cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Install Codex CLI
if: matrix.os != 'windows-2022'
shell: bash
run: |
set -euo pipefail
npm install -g @openai/codex
npm_bin="$(npm config get prefix)/bin"
echo "$npm_bin" >> "$GITHUB_PATH"
export PATH="$npm_bin:$PATH"
codex --version
- name: Install Codex CLI (windows)
if: matrix.os == 'windows-2022'
shell: pwsh
run: |
npm install -g @openai/codex
$npmPrefix = npm config get prefix
Add-Content -Path $env:GITHUB_PATH -Value $npmPrefix
$env:PATH = "$npmPrefix;$env:PATH"
& (Join-Path $npmPrefix "codex.cmd") --version
- name: cargo test
env:
MCP_REPL_CODEX_BACKEND: mock
run: cargo test --quiet -- --test-threads=5
- name: cargo +nightly fmt
run: cargo +nightly fmt --all -- --check
- name: cargo build --release
run: cargo build --release --locked
- name: Smoke test release binary
if: matrix.os != 'windows-2022'
run: ./target/release/mcp-repl --help
- name: Smoke test release binary (windows)
if: matrix.os == 'windows-2022'
shell: pwsh
run: |
.\target\release\mcp-repl.exe --help
- name: Package release archive
if: github.event_name == 'pull_request' && matrix.os != 'windows-2022'
shell: bash
run: |
set -euo pipefail
package_dir="dist/mcp-repl-${{ matrix.target }}"
mkdir -p "$package_dir"
cp target/release/mcp-repl "$package_dir/mcp-repl"
cp README.md LICENSE "$package_dir/"
tar -C dist -czf "dist/${{ matrix.asset_name }}" "mcp-repl-${{ matrix.target }}"
- name: Package release archive (windows)
if: github.event_name == 'pull_request' && matrix.os == 'windows-2022'
shell: pwsh
run: |
$packageDir = "dist/mcp-repl-${{ matrix.target }}"
New-Item -ItemType Directory -Force -Path $packageDir | Out-Null
Copy-Item "target/release/mcp-repl.exe" "$packageDir/mcp-repl.exe"
Copy-Item "README.md" "$packageDir/README.md"
Copy-Item "LICENSE" "$packageDir/LICENSE"
Push-Location "dist"
Compress-Archive -Path "mcp-repl-${{ matrix.target }}" -DestinationPath "${{ matrix.asset_name }}" -Force
Pop-Location
- name: Build PyPI wheel (linux)
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-22.04'
uses: PyO3/maturin-action@v1
with:
maturin-version: v1.11.5
command: build
args: --release --locked --compatibility pypi --out dist/wheels
manylinux: "2014"
- name: Build PyPI wheel (non-linux)
if: github.event_name == 'pull_request' && matrix.os != 'ubuntu-22.04'
uses: PyO3/maturin-action@v1
with:
maturin-version: v1.11.5
command: build
args: --release --locked --compatibility pypi --out dist/wheels
- name: Smoke test PyPI wheel
if: github.event_name == 'pull_request' && matrix.os != 'windows-2022'
shell: bash
run: |
set -euo pipefail
wheel_path="$(find dist/wheels -maxdepth 1 -type f -name 'posit_mcp_repl-*.whl' -print -quit)"
test -n "$wheel_path"
python3 -m venv wheel-smoke
./wheel-smoke/bin/python -m pip install --disable-pip-version-check "$wheel_path"
./wheel-smoke/bin/mcp-repl --help
- name: Smoke test PyPI wheel (windows)
if: github.event_name == 'pull_request' && matrix.os == 'windows-2022'
shell: pwsh
run: |
$wheel = Get-ChildItem -Path "dist/wheels" -Filter "posit_mcp_repl-*.whl" | Select-Object -First 1
if ($null -eq $wheel) {
throw "missing posit_mcp_repl wheel"
}
python -m venv wheel-smoke
.\wheel-smoke\Scripts\python.exe -m pip install --disable-pip-version-check $wheel.FullName
.\wheel-smoke\Scripts\mcp-repl.exe --help