Compare commits

...

5 Commits

Author SHA1 Message Date
Ahmed Ibrahim
ff20f77011 opt 2025-10-22 12:19:55 -07:00
Ahmed Ibrahim
b065eb63fa Merge branch 'main' into add-ci-release 2025-10-22 12:15:13 -07:00
Ahmed Ibrahim
c5ae9fe248 opt 2025-10-22 12:10:21 -07:00
Ahmed Ibrahim
d640572e3b optimization 2025-10-22 11:46:58 -07:00
Ahmed Ibrahim
7cb263b984 add release tests 2025-10-22 11:19:39 -07:00

View File

@@ -94,6 +94,9 @@ jobs:
defaults:
run:
working-directory: codex-rs
env:
IS_MACOS_RELEASE: ${{ matrix.profile == 'release' && startsWith(matrix.runner, 'macos') }}
CARGO_CI_PROFILE: ${{ (matrix.profile == 'release' && startsWith(matrix.runner, 'macos')) && 'ci-release' || matrix.profile }}
strategy:
fail-fast: false
@@ -174,10 +177,6 @@ jobs:
run: |
sudo apt install -y musl-tools pkg-config && sudo rm -rf /var/lib/apt/lists/*
- name: cargo clippy
id: clippy
run: cargo clippy --target ${{ matrix.target }} --all-features --tests --profile ${{ matrix.profile }} -- -D warnings
# Running `cargo build` from the workspace root builds the workspace using
# the union of all features from third-party crates. This can mask errors
# where individual crates have underspecified features. To avoid this, we
@@ -191,7 +190,14 @@ jobs:
find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 \
| xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo check --profile ${{ matrix.profile }}'
- if: ${{ matrix.profile == 'release' && startsWith(matrix.runner, 'macos') }}
name: Enable sccache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: v0.5.4
- uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2
if: ${{ matrix.profile != 'release' || startsWith(matrix.runner, 'macos') }}
with:
tool: nextest
version: 0.9.103
@@ -201,10 +207,35 @@ jobs:
# Tests take too long for release builds to run them on every PR.
if: ${{ matrix.profile != 'release' }}
continue-on-error: true
shell: bash
run: cargo nextest run --all-features --no-fail-fast --target ${{ matrix.target }} --cargo-profile ci-test
env:
RUST_BACKTRACE: 1
- name: tests (release on macOS)
id: test_release
if: ${{ matrix.profile == 'release' && startsWith(matrix.runner, 'macos') }}
continue-on-error: true
shell: bash
run: |
if [[ "$IS_MACOS_RELEASE" == 'true' ]]; then
export RUSTC_WRAPPER="sccache"
export SCCACHE_GHA_ENABLED="on"
fi
cargo nextest run --all-features --no-fail-fast --target "${{ matrix.target }}" --cargo-profile "$CARGO_CI_PROFILE"
env:
RUST_BACKTRACE: 1
- name: cargo clippy
id: clippy
shell: bash
run: |
if [[ "$IS_MACOS_RELEASE" == 'true' ]]; then
export RUSTC_WRAPPER="sccache"
export SCCACHE_GHA_ENABLED="on"
fi
cargo clippy --target "${{ matrix.target }}" --all-features --tests --profile "$CARGO_CI_PROFILE" -- -D warnings
# Save caches explicitly; make non-fatal so cache packaging
# never fails the overall job. Only save when key wasn't hit.
- name: Save cargo home cache
@@ -235,7 +266,8 @@ jobs:
if: |
steps.clippy.outcome == 'failure' ||
steps.cargo_check_all_crates.outcome == 'failure' ||
steps.test.outcome == 'failure'
steps.test.outcome == 'failure' ||
steps.test_release.outcome == 'failure'
run: |
echo "One or more checks failed (clippy, cargo_check_all_crates, or test). See logs for details."
exit 1