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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: Install SQLFluff
run: pip install sqlfluff==2.3.5
run: pip install sqlfluff==3.3.0
- name: Init rustup toolchain
run: rustup show # enough to initialize the toolchain
- name: setup rust build cache
Expand Down
62 changes: 62 additions & 0 deletions .scripts/update-expression-deps.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env -S cargo +nightly -Zscript

---cargo
[package]
edition = "2024"

[dependencies]
tempfile = "3.15"
---
//! This script updates the dependencies for the `expression/deps-workspace` by performing the following steps:
//!
//! 1. Creates a temporary directory.
//! 2. Copies all files from the `expression/deps-workspace` directory to the temporary directory.
//! 4. Runs `cargo update` in the temporary directory to update the dependencies.
//! 5. Copies the updated `Cargo.lock` file back to the `expression/deps-workspace` directory.
//!
//! If any step fails, the script will print an error message and exit with a non-zero status code.

use std::fs;
use std::path::Path;

fn main() {
let temp_dir = tempfile::tempdir().unwrap();

let deps_workspace = Path::new("expression/deps-workspace");

if !deps_workspace.exists() || !deps_workspace.is_dir() {
eprintln!("Dependencies workspace does not exist at {:?}", deps_workspace);
std::process::exit(1);
}

for entry in fs::read_dir(deps_workspace).unwrap() {
let entry = entry.unwrap();
let path = entry.path();
if path.is_file() {
fs::copy(&path, temp_dir.path().join(path.file_name().unwrap())).unwrap();
}
}

eprintln!("Copied dependencies workspace to {:?}", temp_dir);

// Run `cargo update` in the temporary directory

let status = std::process::Command::new("cargo")
.arg("update")
.current_dir(temp_dir.path())
.status()
.unwrap();

if !status.success() {
eprintln!("Failed to update dependencies");
std::process::exit(1);
}

eprintln!("Updated dependencies successfully");

// Copy the updated lockfile back to the workspace

fs::copy(temp_dir.path().join("Cargo.lock"), deps_workspace.join("Cargo.lock")).unwrap();

eprintln!("Copied updated lockfile back to {:?}", deps_workspace);
}
Loading