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
41 changes: 15 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
components: rustfmt, clippy
run: rustup install

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -30,9 +27,9 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-cargo-

- name: Check formatting
run: cargo fmt --all -- --check
Expand Down Expand Up @@ -99,14 +96,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [1.90.0]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
run: rustup install

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -115,10 +109,9 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.rust }}-cargo-
${{ runner.os }}-cargo-
${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-cargo-

- name: Build
run: cargo build --verbose
Expand Down Expand Up @@ -231,9 +224,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
run: rustup install

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -242,7 +233,7 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: windows-latest-cargo-${{ hashFiles('**/Cargo.lock') }}
key: windows-latest-${{ hashFiles('rust-toolchain.toml') }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build Ruby Butler
run: cargo build --release
Expand Down Expand Up @@ -305,12 +296,10 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
run: rustup install

- name: Install cargo-audit
run: cargo install --force cargo-audit
run: cargo install --locked --force cargo-audit

- name: Run security audit
run: cargo audit
Expand All @@ -323,10 +312,10 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
components: llvm-tools-preview
run: rustup install

- name: Install coverage tools
run: rustup component add llvm-tools-preview

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -335,7 +324,7 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: coverage-cargo-${{ hashFiles('**/Cargo.lock') }}
key: coverage-${{ hashFiles('rust-toolchain.toml') }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install cargo-llvm-cov
run: cargo install --force cargo-llvm-cov
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ jobs:
fetch-depth: 0 # Need full history for git info

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
targets: ${{ matrix.target }}
run: rustup install

- name: Install target
run: rustup target add ${{ matrix.target }}

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -93,9 +93,9 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-1.90.0-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ matrix.os }}-${{ hashFiles('rust-toolchain.toml') }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-1.90.0-cargo-
${{ matrix.os }}-${{ hashFiles('rust-toolchain.toml') }}-cargo-
${{ matrix.os }}-cargo-

- name: Build release binary
Expand Down
35 changes: 10 additions & 25 deletions crates/rb-cli/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,59 +86,44 @@ impl RbConfig {
debug!(" Using rubies-dir from config file: {}", dir.display());
self.rubies_dir = other.rubies_dir;
}
} else {
debug!(
" Using rubies-dir from CLI arguments: {}",
self.rubies_dir.as_ref().unwrap().display()
);
} else if let Some(dir) = &self.rubies_dir {
debug!(" Using rubies-dir from CLI arguments: {}", dir.display());
}

if self.ruby_version.is_none() {
if let Some(ref version) = other.ruby_version {
debug!(" Using ruby-version from config file: {}", version);
self.ruby_version = other.ruby_version;
}
} else {
debug!(
" Using ruby-version from CLI arguments: {}",
self.ruby_version.as_ref().unwrap()
);
} else if let Some(version) = &self.ruby_version {
debug!(" Using ruby-version from CLI arguments: {}", version);
}

if self.gem_home.is_none() {
if let Some(ref home) = other.gem_home {
debug!(" Using gem-home from config file: {}", home.display());
self.gem_home = other.gem_home;
}
} else {
debug!(
" Using gem-home from CLI arguments: {}",
self.gem_home.as_ref().unwrap().display()
);
} else if let Some(home) = &self.gem_home {
debug!(" Using gem-home from CLI arguments: {}", home.display());
}

if self.no_bundler.is_none() {
if let Some(no_bundler) = other.no_bundler {
debug!(" Using no-bundler from config file: {}", no_bundler);
self.no_bundler = Some(no_bundler);
}
} else {
debug!(
" Using no-bundler from CLI arguments: {}",
self.no_bundler.unwrap()
);
} else if let Some(no_bundler) = &self.no_bundler {
debug!(" Using no-bundler from CLI arguments: {}", no_bundler);
}

if self.work_dir.is_none() {
if let Some(ref dir) = other.work_dir {
debug!(" Using work-dir from config file: {}", dir.display());
self.work_dir = other.work_dir;
}
} else {
debug!(
" Using work-dir from CLI arguments: {}",
self.work_dir.as_ref().unwrap().display()
);
} else if let Some(dir) = &self.work_dir {
debug!(" Using work-dir from CLI arguments: {}", dir.display());
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "1.98.1"
profile = "minimal"
components = ["rustfmt", "clippy"]
Loading