Skip to content

fix(pty): Fix the streaming cancelled snap #103

fix(pty): Fix the streaming cancelled snap

fix(pty): Fix the streaming cancelled snap #103

Workflow file for this run

name: rust-ci
on:
pull_request: {}
push:
branches: [main, dev]
jobs:
checks:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
defaults:
run:
working-directory: codex-rs
env:
CARGO_INCREMENTAL: "0"
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
name: Linux checks
- runner: macos-14
target: aarch64-apple-darwin
name: macOS checks
steps:
- uses: actions/checkout@v5
# Free disk space on Linux runners to prevent "No space left on device" errors
- name: Free disk space
if: runner.os == 'Linux'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo apt-get update
sudo apt-get install coreutils
docker system prune -af || true
- uses: dtolnay/rust-toolchain@1.90
with:
targets: ${{ matrix.target }}
components: clippy, rustfmt
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Compute lockfile hash
id: lockhash
shell: bash
run: |
set -euo pipefail
echo "hash=${{ hashFiles('codex-rs/Cargo.lock') }}" >> "$GITHUB_OUTPUT"
echo "toolchain_hash=${{ hashFiles('codex-rs/rust-toolchain.toml') }}" >> "$GITHUB_OUTPUT"
# Cache cargo home directory (registry, git deps, etc.)
- name: Restore cargo home cache
id: cache_cargo_home_restore
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ steps.lockhash.outputs.hash }}-${{ steps.lockhash.outputs.toolchain_hash }}
restore-keys: |
cargo-home-${{ matrix.runner }}-${{ matrix.target }}-
# CI checks
- name: cargo check
run: cargo check --target ${{ matrix.target }} --all-features
- name: cargo fmt
run: cargo +nightly fmt -- --check
- name: cargo clippy
run: cargo clippy --target ${{ matrix.target }} --all-features -- -D warnings
# Build mock-acp-agent to a known location for E2E tests
- name: Build mock-acp-agent
run: |
mkdir -p target/mock-acp-out
cargo +nightly build -p mock-acp-agent --profile ci-test --target ${{ matrix.target }} --artifact-dir target/mock-acp-out -Z unstable-options
- name: cargo test
# continue-on-error: true # TODO: Fix pre-existing test failures in codex-app-server
env:
MOCK_ACP_AGENT_BIN: ${{ github.workspace }}/codex-rs/target/mock-acp-out/mock_acp_agent
run: cargo test --profile ci-test --target ${{ matrix.target }} --all-features
# Save cargo home cache
- name: Save cargo home cache
if: always() && !cancelled()
uses: actions/cache/save@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-home-${{ matrix.runner }}-${{ matrix.target }}-${{ steps.lockhash.outputs.hash }}-${{ steps.lockhash.outputs.toolchain_hash }}