Skip to content

Commit ffb8266

Browse files
Merge pull request #306 from Bluemangoo/feature/top-summary
top: implement SUMMARY display
2 parents b0c9aae + db8ecf5 commit ffb8266

File tree

8 files changed

+383
-11
lines changed

8 files changed

+383
-11
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- uses: dtolnay/rust-toolchain@stable
18+
- if: ${{ contains(matrix.os, 'ubuntu') }}
19+
run: |
20+
sudo apt-get update -y
21+
sudo apt-get -yq --no-install-suggests --no-install-recommends install libsystemd-dev
1822
- run: cargo check
1923

2024
test:
@@ -26,6 +30,10 @@ jobs:
2630
steps:
2731
- uses: actions/checkout@v4
2832
- uses: dtolnay/rust-toolchain@stable
33+
- if: ${{ contains(matrix.os, 'ubuntu') }}
34+
run: |
35+
sudo apt-get update -y
36+
sudo apt-get -yq --no-install-suggests --no-install-recommends install libsystemd-dev
2937
- run: cargo test --all
3038

3139
fmt:
@@ -71,6 +79,10 @@ jobs:
7179
uses: dtolnay/rust-toolchain@nightly
7280
with:
7381
components: llvm-tools-preview
82+
- if: ${{ contains(matrix.job.os, 'ubuntu') }}
83+
run: |
84+
sudo apt-get update -y
85+
sudo apt-get -yq --no-install-suggests --no-install-recommends install libsystemd-dev
7486
- name: Test
7587
run: cargo test --no-fail-fast
7688
env:

.github/workflows/code-quality.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ jobs:
8181
- uses: Swatinem/rust-cache@v2
8282
- name: Run sccache-cache
8383
uses: mozilla-actions/[email protected]
84+
- if: ${{ contains(matrix.job.os, 'ubuntu') }}
85+
run: |
86+
sudo apt-get update -y
87+
sudo apt-get -yq --no-install-suggests --no-install-recommends install libsystemd-dev
8488
- name: Initialize workflow variables
8589
id: vars
8690
shell: bash

Cargo.lock

Lines changed: 66 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ thiserror = "2.0.4"
6262
uucore = "0.0.30"
6363
walkdir = "2.5.0"
6464
windows = { version = "0.60.0" }
65+
windows-sys = { version = "0.59.0", default-features = false }
6566
xattr = "1.3.1"
6667

6768
[dependencies]

src/uu/top/Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,22 @@ keywords = ["acl", "uutils", "cross-platform", "cli", "utility"]
1212
categories = ["command-line-utilities"]
1313

1414
[dependencies]
15-
uucore = { workspace = true, features = ["utmpx"] }
15+
uucore = { workspace = true, features = ["utmpx", "uptime"] }
1616
clap = { workspace = true }
1717
libc = { workspace = true }
1818
nix = { workspace = true }
1919
prettytable-rs = { workspace = true }
2020
sysinfo = { workspace = true }
2121
chrono = { workspace = true }
22+
bytesize = { workspace = true }
23+
[target.'cfg(target_os="windows")'.dependencies]
24+
windows-sys = { workspace = true, features = [
25+
"Win32_System_RemoteDesktop",
26+
"Win32_System_SystemInformation",
27+
] }
28+
29+
[target.'cfg(target_os="linux")'.build-dependencies]
30+
pkg-config = "0.3.31"
2231

2332
[lib]
2433
path = "src/top.rs"

src/uu/top/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
#[cfg(target_os = "linux")]
3+
pkg_config::find_library("libsystemd").unwrap();
4+
}

0 commit comments

Comments
 (0)