fix(ci): graceful tailwind skip and add dx fmt check
build.rs no longer panics when bunx is unavailable, allowing cargo clippy/test to run in CI without bun installed. Added dx fmt --check to the format job for RSX formatting validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,12 @@ jobs:
|
|||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
- run: rustup component add rustfmt
|
- run: rustup component add rustfmt
|
||||||
- run: cargo fmt --check
|
- run: cargo fmt --check
|
||||||
|
- name: Install dx CLI
|
||||||
|
run: |
|
||||||
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||||
|
cargo binstall dioxus-cli@0.7.3 -y --force
|
||||||
|
- name: RSX format check
|
||||||
|
run: dx fmt --check
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
name: Clippy
|
name: Clippy
|
||||||
|
|||||||
15
build.rs
15
build.rs
@@ -1,8 +1,9 @@
|
|||||||
#[allow(clippy::expect_used)]
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
println!("cargo:rerun-if-changed=./styles/input.css");
|
println!("cargo:rerun-if-changed=./styles/input.css");
|
||||||
Command::new("bunx")
|
|
||||||
|
// Tailwind build is optional - skip gracefully in CI or environments without bun
|
||||||
|
match Command::new("bunx")
|
||||||
.args([
|
.args([
|
||||||
"@tailwindcss/cli",
|
"@tailwindcss/cli",
|
||||||
"-i",
|
"-i",
|
||||||
@@ -11,7 +12,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
"./assets/tailwind.css",
|
"./assets/tailwind.css",
|
||||||
])
|
])
|
||||||
.status()
|
.status()
|
||||||
.expect("could not run tailwind");
|
{
|
||||||
|
Ok(status) if !status.success() => {
|
||||||
|
println!("cargo:warning=tailwind build exited with {status}, skipping CSS generation");
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
println!("cargo:warning=bunx not found ({e}), skipping tailwind CSS generation");
|
||||||
|
}
|
||||||
|
Ok(_) => {}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user