Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Fix build break and build release (#2242)

pakrym-oai97a27ffc77b1
diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml
index 97075a1f07..0fd67175a9 100644
--- a/.github/workflows/rust-ci.yml
+++ b/.github/workflows/rust-ci.yml
@@ -34,7 +34,7 @@ jobs:
# CI to validate on different os/targets
lint_build_test:
- name: ${{ matrix.runner }} - ${{ matrix.target }}
+ name: ${{ matrix.runner }} - ${{ matrix.target }}${{ matrix.profile == 'release' && ' (release)' || '' }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
defaults:
@@ -49,18 +49,31 @@ jobs:
include:
- runner: macos-14
target: aarch64-apple-darwin
+ profile: dev
- runner: macos-14
target: x86_64-apple-darwin
+ profile: dev
+ - runner: macos-14
+ target: aarch64-apple-darwin
+ profile: release
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
+ profile: dev
+ - runner: ubuntu-24.04
+ target: x86_64-unknown-linux-musl
+ profile: release
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
+ profile: dev
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
+ profile: dev
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
+ profile: dev
- runner: windows-latest
target: x86_64-pc-windows-msvc
+ profile: dev
steps:
- uses: actions/checkout@v4
@@ -77,7 +90,7 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ github.workspace }}/codex-rs/target/
- key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
+ key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
name: Install musl build tools
@@ -86,7 +99,6 @@ jobs:
- name: cargo clippy
id: clippy
- continue-on-error: true
run: cargo clippy --target ${{ matrix.target }} --all-features --tests -- -D warnings
# Running `cargo build` from the workspace root builds the workspace using
@@ -98,12 +110,12 @@ jobs:
id: build
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
continue-on-error: true
- run: find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 | xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo build'
+ run: find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 | xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo build --profile ${{ matrix.profile }}'
- name: cargo test
id: test
continue-on-error: true
- run: cargo test --all-features --target ${{ matrix.target }}
+ run: cargo test --all-features --target ${{ matrix.target }} --profile ${{ matrix.profile }}
env:
RUST_BACKTRACE: 1
diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml
index 8bf7361da9..d3e313b3cc 100644
--- a/.github/workflows/rust-release.yml
+++ b/.github/workflows/rust-release.yml
@@ -87,7 +87,7 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ github.workspace }}/codex-rs/target/
- key: cargo-release-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
+ key: cargo-release-${{ matrix.runner }}-${{ matrix.target }}-release-${{ hashFiles('**/Cargo.lock') }}
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
name: Install musl build tools