Fix build break and build release (#2242)

Build release profile for one configuration.
This commit is contained in:
pakrym-oai
2025-08-12 15:56:45 -07:00
committed by GitHub
parent 12cf0dd868
commit 97a27ffc77
2 changed files with 18 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ jobs:
# CI to validate on different os/targets # CI to validate on different os/targets
lint_build_test: lint_build_test:
name: ${{ matrix.runner }} - ${{ matrix.target }} name: ${{ matrix.runner }} - ${{ matrix.target }}${{ matrix.profile == 'release' && ' (release)' || '' }}
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
timeout-minutes: 30 timeout-minutes: 30
defaults: defaults:
@@ -49,18 +49,31 @@ jobs:
include: include:
- runner: macos-14 - runner: macos-14
target: aarch64-apple-darwin target: aarch64-apple-darwin
profile: dev
- runner: macos-14 - runner: macos-14
target: x86_64-apple-darwin target: x86_64-apple-darwin
profile: dev
- runner: macos-14
target: aarch64-apple-darwin
profile: release
- runner: ubuntu-24.04 - runner: ubuntu-24.04
target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
profile: dev
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
profile: release
- runner: ubuntu-24.04 - runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
profile: dev
- runner: ubuntu-24.04-arm - runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
profile: dev
- runner: ubuntu-24.04-arm - runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu target: aarch64-unknown-linux-gnu
profile: dev
- runner: windows-latest - runner: windows-latest
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
profile: dev
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -77,7 +90,7 @@ jobs:
~/.cargo/registry/cache/ ~/.cargo/registry/cache/
~/.cargo/git/db/ ~/.cargo/git/db/
${{ github.workspace }}/codex-rs/target/ ${{ 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'}} - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
name: Install musl build tools name: Install musl build tools
@@ -86,7 +99,6 @@ jobs:
- name: cargo clippy - name: cargo clippy
id: clippy id: clippy
continue-on-error: true
run: cargo clippy --target ${{ matrix.target }} --all-features --tests -- -D warnings run: cargo clippy --target ${{ matrix.target }} --all-features --tests -- -D warnings
# Running `cargo build` from the workspace root builds the workspace using # Running `cargo build` from the workspace root builds the workspace using
@@ -98,12 +110,12 @@ jobs:
id: build id: build
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
continue-on-error: true 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 - name: cargo test
id: test id: test
continue-on-error: true continue-on-error: true
run: cargo test --all-features --target ${{ matrix.target }} run: cargo test --all-features --target ${{ matrix.target }} --profile ${{ matrix.profile }}
env: env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1

View File

@@ -87,7 +87,7 @@ jobs:
~/.cargo/registry/cache/ ~/.cargo/registry/cache/
~/.cargo/git/db/ ~/.cargo/git/db/
${{ github.workspace }}/codex-rs/target/ ${{ 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'}} - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
name: Install musl build tools name: Install musl build tools