diff --git a/.github/workflows/continuous-build-linux.yml b/.github/workflows/continuous-build-linux.yml index 39de640b9..712e8c5b6 100644 --- a/.github/workflows/continuous-build-linux.yml +++ b/.github/workflows/continuous-build-linux.yml @@ -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 @@ -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/**' diff --git a/.github/workflows/continuous-build-macos.yml b/.github/workflows/continuous-build-macos.yml index c8915dd7c..6245e7e95 100644 --- a/.github/workflows/continuous-build-macos.yml +++ b/.github/workflows/continuous-build-macos.yml @@ -28,33 +28,37 @@ 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 @@ -62,10 +66,10 @@ jobs: 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/*' diff --git a/.github/workflows/continuous-build-openbsd.yml b/.github/workflows/continuous-build-openbsd.yml index 6925ebbbf..84d631f25 100644 --- a/.github/workflows/continuous-build-openbsd.yml +++ b/.github/workflows/continuous-build-openbsd.yml @@ -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/*' diff --git a/.github/workflows/test-snap-can-build.yml b/.github/workflows/test-snap-can-build.yml index 6df8e4708..a59b58d09 100644 --- a/.github/workflows/test-snap-can-build.yml +++ b/.github/workflows/test-snap-can-build.yml @@ -4,7 +4,7 @@ on: push: branches: [ main ] tags-ignore: - - '*.*' + - '*.*' paths: - 'src/**' - '!src/osx/**' @@ -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 diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 0d5842a09..ba29d83f4 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -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)); diff --git a/src/freebsd/btop_collect.cpp b/src/freebsd/btop_collect.cpp index b4034c776..29e54bf2b 100644 --- a/src/freebsd/btop_collect.cpp +++ b/src/freebsd/btop_collect.cpp @@ -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 diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index c08534a02..462ed77bd 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -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; diff --git a/src/openbsd/btop_collect.cpp b/src/openbsd/btop_collect.cpp index a8c395e35..480b83465 100644 --- a/src/openbsd/btop_collect.cpp +++ b/src/openbsd/btop_collect.cpp @@ -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 diff --git a/src/osx/btop_collect.cpp b/src/osx/btop_collect.cpp index 8c6570506..4d54e328e 100644 --- a/src/osx/btop_collect.cpp +++ b/src/osx/btop_collect.cpp @@ -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