ci: enable Dependabot

This commit is contained in:
sxyazi 2025-09-06 23:40:06 +08:00
parent 021d86f0d1
commit 81a0cf4a1e
No known key found for this signature in database
16 changed files with 60 additions and 46 deletions

15
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
- package-ecosystem: "npm"
directory: "/scripts/validate-form"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"

View file

@ -12,7 +12,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install Nix
uses: cachix/install-nix-action@v31

View file

@ -14,7 +14,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup Rust toolchain
run: |
@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Rust toolchain
run: |
@ -47,7 +47,7 @@ jobs:
stylua:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -39,7 +39,7 @@ jobs:
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER: sparc64-linux-gnu-gcc
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install gcc
if: matrix.gcc != ''
@ -77,7 +77,7 @@ jobs:
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: lld-link.exe
CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_LINKER: lld-link.exe
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup Rust toolchain
run: rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
@ -115,7 +115,7 @@ jobs:
container:
image: docker://ghcr.io/cross-rs/${{ matrix.target }}:edge
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
@ -145,7 +145,7 @@ jobs:
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
@ -171,7 +171,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build-snap]
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
pattern: snap-*
merge-multiple: true
@ -200,7 +200,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build-unix, build-windows, build-musl, build-snap]
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
merge-multiple: true
@ -227,9 +227,9 @@ jobs:
echo "Generated on: $(date -u +"%Y-%m-%d %H:%M") UTC" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
merge-multiple: true

View file

@ -8,7 +8,7 @@ jobs:
winget:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
merge-multiple: true

View file

@ -18,7 +18,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup Rust toolchain
run: rustup toolchain install stable --profile minimal

View file

@ -12,10 +12,10 @@ jobs:
permissions:
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-js: 20
@ -25,7 +25,7 @@ jobs:
npm ci
- name: Validate Form
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const script = require('./scripts/validate-form/main.js')

View file

@ -32,7 +32,6 @@ impl UserData for TaskSnap {
fields.add_field_method_get("running", |_, me| Ok(me.prog.running()));
fields.add_field_method_get("success", |_, me| Ok(me.prog.success()));
fields.add_field_method_get("cleaning", |_, me| Ok(me.prog.cleaning()));
fields.add_field_method_get("percent", |_, me| Ok(me.prog.percent()));
}
}

View file

@ -1,7 +1,7 @@
use std::ops::Deref;
use mlua::{AnyUserData, ExternalError, FromLua, Lua, MetaMethod, UserData, UserDataFields, UserDataMethods, UserDataRef, Value};
use yazi_shared::{IntoOsStr, url::{UrlBufCov, UrlCow}};
use yazi_shared::{IntoOsStr, url::UrlCow};
use crate::{Urn, cached_field, deprecate};

View file

@ -75,7 +75,7 @@ function Tasks:progress_redraw(snap, y)
local kind = snap.prog.kind
if kind == "FilePaste" or kind == "FileDelete" then
local percent
if snap.cleaning then
if snap.success then
percent = "Cleaning…"
else
percent = string.format("%3d%%", math.floor(snap.percent))

View file

@ -31,7 +31,7 @@ impl FileProgPaste {
pub fn success(self) -> bool { self.collected && self.success_files == self.total_files }
pub fn cleaning(self) -> bool { !self.cleaned && self.success() }
pub fn cleaned(self) -> bool { self.cleaned }
pub fn percent(self) -> Option<f32> {
Some(if self.success() {
@ -66,7 +66,7 @@ impl FileProgLink {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}
@ -96,7 +96,7 @@ impl FileProgHardlink {
pub fn success(self) -> bool { self.collected && self.success == self.total }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}
@ -131,7 +131,7 @@ impl FileProgDelete {
pub fn success(self) -> bool { self.collected && self.success_files == self.total_files }
pub fn cleaning(self) -> bool { !self.cleaned && self.success() }
pub fn cleaned(self) -> bool { self.cleaned }
pub fn percent(self) -> Option<f32> {
Some(if self.success() {
@ -166,7 +166,7 @@ impl FileProgTrash {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}

View file

@ -23,7 +23,7 @@ impl PluginProgEntry {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}

View file

@ -23,7 +23,7 @@ impl PreworkProgFetch {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}
@ -50,7 +50,7 @@ impl PreworkProgLoad {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}
@ -77,7 +77,7 @@ impl PreworkProgSize {
pub fn success(self) -> bool { self.done }
pub fn cleaning(self) -> bool { self.success() }
pub fn cleaned(self) -> bool { false }
pub fn percent(self) -> Option<f32> { None }
}

View file

@ -24,7 +24,7 @@ impl ProcessProgBlock {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { !self.cleaned && self.success() }
pub fn cleaned(self) -> bool { self.cleaned }
pub fn percent(self) -> Option<f32> { None }
}
@ -52,7 +52,7 @@ impl ProcessProgOrphan {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { !self.cleaned && self.success() }
pub fn cleaned(self) -> bool { self.cleaned }
pub fn percent(self) -> Option<f32> { None }
}
@ -80,7 +80,7 @@ impl ProcessProgBg {
pub fn success(self) -> bool { self.state == Some(true) }
pub fn cleaning(self) -> bool { !self.cleaned && self.success() }
pub fn cleaned(self) -> bool { self.cleaned }
pub fn percent(self) -> Option<f32> { None }
}

View file

@ -101,24 +101,24 @@ impl TaskProg {
}
}
pub fn cleaning(self) -> bool {
pub fn cleaned(self) -> bool {
match self {
// File
Self::FilePaste(p) => p.cleaning(),
Self::FileLink(p) => p.cleaning(),
Self::FileHardlink(p) => p.cleaning(),
Self::FileDelete(p) => p.cleaning(),
Self::FileTrash(p) => p.cleaning(),
Self::FilePaste(p) => p.cleaned(),
Self::FileLink(p) => p.cleaned(),
Self::FileHardlink(p) => p.cleaned(),
Self::FileDelete(p) => p.cleaned(),
Self::FileTrash(p) => p.cleaned(),
// Plugin
Self::PluginEntry(p) => p.cleaning(),
Self::PluginEntry(p) => p.cleaned(),
// Prework
Self::PreworkFetch(p) => p.cleaning(),
Self::PreworkLoad(p) => p.cleaning(),
Self::PreworkSize(p) => p.cleaning(),
Self::PreworkFetch(p) => p.cleaned(),
Self::PreworkLoad(p) => p.cleaned(),
Self::PreworkSize(p) => p.cleaned(),
// Process
Self::ProcessBlock(p) => p.cleaning(),
Self::ProcessOrphan(p) => p.cleaning(),
Self::ProcessBg(p) => p.cleaning(),
Self::ProcessBlock(p) => p.cleaned(),
Self::ProcessOrphan(p) => p.cleaned(),
Self::ProcessBg(p) => p.cleaned(),
}
}

View file

@ -390,7 +390,7 @@ impl Scheduler {
let Some(task) = ongoing.get_mut(op.id) else { continue };
op.out.reduce(task);
if !task.prog.success() {
if !task.prog.success() && !task.prog.cleaned() {
continue;
} else if let Some(hook) = ongoing.hooks.pop(op.id)
&& let Some(fut) = hook.call(false)