CI: use /tmp for ecosystem clone; fix rustfmt violations
All checks were successful
Mirror to GitHub / mirror (push) Successful in 2s

This commit is contained in:
Breadway 2026-06-19 08:38:40 +08:00
parent d177cc8d82
commit 8aceab7857
4 changed files with 20 additions and 13 deletions

View file

@ -9,7 +9,7 @@ permissions:
env: env:
DL_DIR: /srv/breadway-dl DL_DIR: /srv/breadway-dl
ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
jobs: jobs:
build: build:
@ -41,12 +41,8 @@ jobs:
- name: ensure bread-ecosystem - name: ensure bread-ecosystem
run: | run: |
if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then rm -rf "${ECOSYSTEM_DIR}"
git -C "${ECOSYSTEM_DIR}" pull --ff-only git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
else
mkdir -p "$(dirname "${ECOSYSTEM_DIR}")"
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
fi
- name: regenerate index.json - name: regenerate index.json
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh" run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"

View file

@ -119,7 +119,9 @@ pub fn run(cfg: &Config, profile_name: &str) -> Outcome {
on_bootstrap = true; on_bootstrap = true;
log(&format!("bootstrap connected: {}", bdef.ssid)); log(&format!("bootstrap connected: {}", bdef.ssid));
} }
Err(e) => log(&format!("bootstrap connect failed: {}{e}", bdef.ssid)), Err(e) => {
log(&format!("bootstrap connect failed: {}{e}", bdef.ssid))
}
} }
} else { } else {
log(&format!("bootstrap not in range: {}", bdef.ssid)); log(&format!("bootstrap not in range: {}", bdef.ssid));

View file

@ -319,7 +319,15 @@ pub fn connect_verbose(iface: &str, net: &NetworkDef, wait: u32, dns: &str) -> R
} }
let o = run( let o = run(
"nmcli", "nmcli",
&["--wait", &wait_s, "connection", "up", &profile, "ifname", iface], &[
"--wait",
&wait_s,
"connection",
"up",
&profile,
"ifname",
iface,
],
Duration::from_secs(wait as u64 + 15), Duration::from_secs(wait as u64 + 15),
); );
if !o.success { if !o.success {

View file

@ -65,9 +65,8 @@ fn spawn_nm_monitor(tx: mpsc::Sender<()>) {
let mut last = Instant::now() - Duration::from_secs(10); let mut last = Instant::now() - Duration::from_secs(10);
for line in reader.lines().map_while(Result::ok) { for line in reader.lines().map_while(Result::ok) {
let l = line.to_lowercase(); let l = line.to_lowercase();
let interesting = l.contains("disconnect") let interesting =
|| l.contains("unavailable") l.contains("disconnect") || l.contains("unavailable") || l.contains("failed");
|| l.contains("failed");
if interesting && last.elapsed() > Duration::from_millis(1500) { if interesting && last.elapsed() > Duration::from_millis(1500) {
last = Instant::now(); last = Instant::now();
let _ = tx.send(()); let _ = tx.send(());
@ -199,7 +198,9 @@ pub fn run(mut cfg: Config, run_initial: bool) -> i32 {
Urgency::Normal, Urgency::Normal,
); );
} }
let elapsed = last_flow_at.map(|t| t.elapsed().as_secs()).unwrap_or(u64::MAX); let elapsed = last_flow_at
.map(|t| t.elapsed().as_secs())
.unwrap_or(u64::MAX);
if elapsed >= FLOW_COOLDOWN { if elapsed >= FLOW_COOLDOWN {
log(&format!( log(&format!(
"watch: down ({:?}) profile={profile} ssid={:?} — running flow", "watch: down ({:?}) profile={profile} ssid={:?} — running flow",