Skip to content

Commit dfb1734

Browse files
xc2chenjiahan
andauthored
ci: build linux debug binary directly for CI purpose to speedup PR check (#7243)
ci: build without docker when build on shared runner Co-authored-by: xc2 <[email protected]> Co-authored-by: neverland <[email protected]>
1 parent fbe97be commit dfb1734

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
with:
6363
target: x86_64-unknown-linux-gnu
6464
profile: "debug"
65+
native: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS == '"ubuntu-latest"' }}
6566
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }}
6667
skipable: ${{ needs.check-changed.outputs.changed != 'true' }}
6768

.github/workflows/reusable-build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ on:
3939
target:
4040
required: true
4141
type: string
42+
native:
43+
required: false
44+
type: boolean
45+
default: false
4246
runner: # Runner labels
4347
required: true
4448
type: string
@@ -133,7 +137,7 @@ jobs:
133137

134138
# Linux
135139
- name: Build x86_64-unknown-linux-gnu in Docker
136-
if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' && steps.check_cache.outputs.exists != 'true' && !inputs.skipable }}
140+
if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' && steps.check_cache.outputs.exists != 'true' && !inputs.skipable && !inputs.native }}
137141
uses: ./.github/actions/docker-build
138142
with:
139143
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
@@ -182,9 +186,13 @@ jobs:
182186
183187
# setup rust target for windows and macos
184188
- name: Setup Rust Target
185-
if: ${{ !contains(inputs.target, 'linux') && !inputs.skipable }}
189+
if: ${{ (!contains(inputs.target, 'linux') || inputs.native) && !inputs.skipable }}
186190
run: rustup target add ${{ inputs.target }}
187191

192+
- name: Build ${{ inputs.target }}
193+
if: ${{ inputs.native && contains(inputs.target, 'linux') && steps.check_cache.outputs.files_exists != 'true' && !inputs.skipable }}
194+
run: RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
195+
188196
# Windows
189197

190198
- name: Build i686-pc-windows-msvc

0 commit comments

Comments
 (0)