Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/actions/rust-paths/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 RustFS Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Configure Rust Paths"
description: "Use user-writable Rust paths on self-hosted lab runners"

runs:
using: "composite"
steps:
- name: Configure user-writable Rust paths
if: runner.environment == 'self-hosted'
shell: bash
run: |
set -euo pipefail
mkdir -p "$HOME/.rustup" "$HOME/.cargo/bin"
echo "RUSTUP_HOME=$HOME/.rustup" >> "$GITHUB_ENV"
echo "CARGO_HOME=$HOME/.cargo" >> "$GITHUB_ENV"
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
4 changes: 4 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ runs:
with:
version: "25.12.19"

# Lab runners ship root-owned /usr/local/{rustup,cargo}; rustup cannot update toolchains there.
- name: Configure user-writable Rust paths
uses: ./.github/actions/rust-paths

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
runs-on: [self-hosted, lab-small]
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/rust-paths
- uses: dtolnay/rust-toolchain@stable
- name: Typos check with custom config file
uses: crate-ci/typos@master
Expand Down Expand Up @@ -196,6 +197,9 @@ jobs:
- name: Make binary executable
run: chmod +x ./target/debug/rustfs

- name: Configure user-writable Rust paths
uses: ./.github/actions/rust-paths

- name: Setup Rust toolchain for s3s-e2e installation
uses: dtolnay/rust-toolchain@stable

Expand Down
Loading