Skip to content

Commit 8e72af3

Browse files
authored
feat: add rust_enable install scripts
1 parent a4b8397 commit 8e72af3

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/actions/build-node-python/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ inputs:
8585
run_python_build:
8686
default: true
8787
required: false
88+
# Rust
89+
enable_rust:
90+
description: "enables the rust part of the action"
91+
default: true
92+
required: true
8893

8994
runs:
9095
using: "composite"
@@ -125,6 +130,22 @@ runs:
125130
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
126131
sudo apt-get install postgresql-16-pgvector -y
127132
shell: bash
133+
# Rust
134+
- name: Install Rust
135+
if: inputs.enable_rust == 'true'
136+
run: |
137+
if ! command -v rustup &> /dev/null ; then
138+
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain stable -y
139+
140+
# Resolve the correct CARGO_HOME path depending on OS
141+
if [[ "$RUNNER_OS" == "Windows" ]]; then
142+
echo "${CARGO_HOME:-$USERPROFILE/.cargo}/bin" | sed 's|/|\\|g' >> $GITHUB_PATH
143+
else
144+
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
145+
fi
146+
fi
147+
# rustup install stable
148+
shell: bash
128149
# General
129150
- name: Git config
130151
if: inputs.github_ro_token != ''

.github/workflows/build-node-python.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ on:
7979
required: false
8080
type: boolean
8181
default: false
82+
rust_enable:
83+
description: 'Enable Rust install'
84+
required: false
85+
type: boolean
86+
default: false
8287
timeout:
8388
description: "Timeout for each job in minutes."
8489
type: number
@@ -144,6 +149,7 @@ jobs:
144149
with:
145150
enable_node: true
146151
enable_python: false
152+
enable_rust: ${{ inputs.rust_enable }}
147153
run_parallel: ${{ inputs.run_parallel }}
148154
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
149155
npm_registry: ${{ env.NPM_REGISTRY }}
@@ -183,6 +189,7 @@ jobs:
183189
with:
184190
enable_node: false
185191
enable_python: true
192+
enable_rust: ${{ inputs.rust_enable }}
186193
run_parallel: ${{ inputs.run_parallel }}
187194
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
188195
npm_registry: ${{ env.NPM_REGISTRY }}
@@ -273,6 +280,7 @@ jobs:
273280
- name: Build node and python
274281
uses: ./tmp/github-workflows/.github/actions/build-node-python
275282
with:
283+
enable_rust: ${{ inputs.rust_enable }}
276284
run_parallel: ${{ inputs.run_parallel }}
277285
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
278286
npm_registry: ${{ env.NPM_REGISTRY }}
@@ -415,6 +423,7 @@ jobs:
415423
- name: Build node and python
416424
uses: ./tmp/github-workflows/.github/actions/build-node-python
417425
with:
426+
enable_rust: ${{ inputs.rust_enable }}
418427
run_parallel: ${{ inputs.run_parallel }}
419428
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
420429
npm_registry: ${{ env.NPM_REGISTRY }}

0 commit comments

Comments
 (0)