Skip to content

Commit 97a27ff

Browse files
authored
Fix build break and build release (#2242)
Build release profile for one configuration.
1 parent 12cf0dd commit 97a27ff

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/rust-ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
# CI to validate on different os/targets
3636
lint_build_test:
37-
name: ${{ matrix.runner }} - ${{ matrix.target }}
37+
name: ${{ matrix.runner }} - ${{ matrix.target }}${{ matrix.profile == 'release' && ' (release)' || '' }}
3838
runs-on: ${{ matrix.runner }}
3939
timeout-minutes: 30
4040
defaults:
@@ -49,18 +49,31 @@ jobs:
4949
include:
5050
- runner: macos-14
5151
target: aarch64-apple-darwin
52+
profile: dev
5253
- runner: macos-14
5354
target: x86_64-apple-darwin
55+
profile: dev
56+
- runner: macos-14
57+
target: aarch64-apple-darwin
58+
profile: release
5459
- runner: ubuntu-24.04
5560
target: x86_64-unknown-linux-musl
61+
profile: dev
62+
- runner: ubuntu-24.04
63+
target: x86_64-unknown-linux-musl
64+
profile: release
5665
- runner: ubuntu-24.04
5766
target: x86_64-unknown-linux-gnu
67+
profile: dev
5868
- runner: ubuntu-24.04-arm
5969
target: aarch64-unknown-linux-musl
70+
profile: dev
6071
- runner: ubuntu-24.04-arm
6172
target: aarch64-unknown-linux-gnu
73+
profile: dev
6274
- runner: windows-latest
6375
target: x86_64-pc-windows-msvc
76+
profile: dev
6477

6578
steps:
6679
- uses: actions/checkout@v4
@@ -77,7 +90,7 @@ jobs:
7790
~/.cargo/registry/cache/
7891
~/.cargo/git/db/
7992
${{ github.workspace }}/codex-rs/target/
80-
key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
93+
key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}
8194

8295
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
8396
name: Install musl build tools
@@ -86,7 +99,6 @@ jobs:
8699
87100
- name: cargo clippy
88101
id: clippy
89-
continue-on-error: true
90102
run: cargo clippy --target ${{ matrix.target }} --all-features --tests -- -D warnings
91103

92104
# Running `cargo build` from the workspace root builds the workspace using
@@ -98,12 +110,12 @@ jobs:
98110
id: build
99111
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
100112
continue-on-error: true
101-
run: find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 | xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo build'
113+
run: find . -name Cargo.toml -mindepth 2 -maxdepth 2 -print0 | xargs -0 -n1 -I{} bash -c 'cd "$(dirname "{}")" && cargo build --profile ${{ matrix.profile }}'
102114

103115
- name: cargo test
104116
id: test
105117
continue-on-error: true
106-
run: cargo test --all-features --target ${{ matrix.target }}
118+
run: cargo test --all-features --target ${{ matrix.target }} --profile ${{ matrix.profile }}
107119
env:
108120
RUST_BACKTRACE: 1
109121

.github/workflows/rust-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
~/.cargo/registry/cache/
8888
~/.cargo/git/db/
8989
${{ github.workspace }}/codex-rs/target/
90-
key: cargo-release-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
90+
key: cargo-release-${{ matrix.runner }}-${{ matrix.target }}-release-${{ hashFiles('**/Cargo.lock') }}
9191

9292
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
9393
name: Install musl build tools

0 commit comments

Comments
 (0)