Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
coillteoir authored Jun 28, 2024
2 parents 830cff8 + e4f69cd commit 4521d2a
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: git config --global --add safe.directory /__w/btop/btop

- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -121,7 +121,7 @@ jobs:
cp bin/btop .artifacts/$FILENAME
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: btop-${{ matrix.toolchain }}
path: '.artifacts/**'
30 changes: 17 additions & 13 deletions .github/workflows/continuous-build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,44 +28,48 @@ on:
- '.github/workflows/continuous-build-macos.yml'

jobs:
build-macos11:
runs-on: macos-11
build-macos12:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Compile
run: |
make CXX=g++-11 ARCH=x86_64 STATIC=true STRIP=true
make CXX=g++-12 ARCH=x86_64 STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-x86_64-BigSur-$GIT_HASH
mv bin/btop bin/btop-x86_64-Monterey-$GIT_HASH
ls -alh bin
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: btop-x86_64-macos11-BigSur
name: btop-x86_64-macos12-Monterey
path: 'bin/*'

build-macos12:
runs-on: macos-12
build-macos13:
runs-on: macos-13
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Compile
run: |
make CXX=g++-12 ARCH=x86_64 STATIC=true STRIP=true
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
mv bin/btop bin/btop-x86_64-Monterey-$GIT_HASH
mv bin/btop bin/btop-x86_64-Ventura-$GIT_HASH
ls -alh bin
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: btop-x86_64-macos12-Monterey
name: btop-x86_64-macos13-Ventura
path: 'bin/*'
2 changes: 1 addition & 1 deletion .github/workflows/continuous-build-openbsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
mv bin/btop bin/btop-GCC11-"$GIT_HASH"
ls -alh bin
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: btop-x86_64-openbsd-7.4
path: 'bin/*'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-snap-can-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ main ]
tags-ignore:
- '*.*'
- '*.*'
paths:
- 'src/**'
- '!src/osx/**'
Expand All @@ -21,16 +21,16 @@ on:
- 'include/**'
- 'Makefile'
- '.github/workflows/test-snap-can-build.yml'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: snapcore/action-build@v1
id: build
Expand Down
2 changes: 1 addition & 1 deletion src/btop_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ namespace Mem {
if (not Config::getS("io_graph_speeds").empty()) {
auto split = ssplit(Config::getS("io_graph_speeds"));
for (const auto& entry : split) {
auto vals = ssplit(entry);
auto vals = ssplit(entry, ':');
if (vals.size() == 2 and mem.disks.contains(vals.at(0)) and isint(vals.at(1)))
try {
custom_speeds[vals.at(0)] = std::stoi(vals.at(1));
Expand Down
9 changes: 7 additions & 2 deletions src/freebsd/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,13 @@ namespace Mem {
disk.total = vfs.f_blocks * vfs.f_frsize;
disk.free = vfs.f_bfree * vfs.f_frsize;
disk.used = disk.total - disk.free;
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
if (disk.total != 0) {
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
} else {
disk.used_percent = 0;
disk.free_percent = 0;
}
}

//? Setup disks order in UI and add swap if enabled
Expand Down
9 changes: 7 additions & 2 deletions src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1936,8 +1936,13 @@ namespace Mem {
disk.total = vfs.f_blocks * vfs.f_frsize;
disk.free = (free_priv ? vfs.f_bfree : vfs.f_bavail) * vfs.f_frsize;
disk.used = disk.total - disk.free;
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
if (disk.total != 0) {
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
} else {
disk.used_percent = 0;
disk.free_percent = 0;
}
return pair{disk, -1};
});
++it;
Expand Down
9 changes: 7 additions & 2 deletions src/openbsd/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,13 @@ namespace Mem {
disk.total = vfs.f_blocks * vfs.f_frsize;
disk.free = vfs.f_bfree * vfs.f_frsize;
disk.used = disk.total - disk.free;
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
if (disk.total != 0) {
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
} else {
disk.used_percent = 0;
disk.free_percent = 0;
}
}

//? Setup disks order in UI and add swap if enabled
Expand Down
9 changes: 7 additions & 2 deletions src/osx/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,13 @@ namespace Mem {
disk.total = vfs.f_blocks * vfs.f_frsize;
disk.free = vfs.f_bfree * vfs.f_frsize;
disk.used = disk.total - disk.free;
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
if (disk.total != 0) {
disk.used_percent = round((double)disk.used * 100 / disk.total);
disk.free_percent = 100 - disk.used_percent;
} else {
disk.used_percent = 0;
disk.free_percent = 0;
}
}

//? Setup disks order in UI and add swap if enabled
Expand Down

0 comments on commit 4521d2a

Please sign in to comment.