fix(acp): Allow multiple Ctrl-C calls to exit program #98
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| - name: cargo test | |
| # continue-on-error: true # TODO: Fix pre-existing test failures in codex-app-server | |
| 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 }} |