mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6dc463d9d | |||
| dfce0eec66 | |||
| c148cd9044 | |||
| 2893f73f47 | |||
| 5103ebe0d8 |
+249
-221
@@ -22,56 +22,56 @@ jobs:
|
|||||||
- { os: macos-latest }
|
- { os: macos-latest }
|
||||||
- { os: windows-latest }
|
- { os: windows-latest }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# 'windows-latest' `cargo fmt` is bugged for this project (see reasons @ GH:rust-lang/rustfmt #3324, #3590, #3688 ; waiting for repair)
|
# 'windows-latest' `cargo fmt` is bugged for this project (see reasons @ GH:rust-lang/rustfmt #3324, #3590, #3688 ; waiting for repair)
|
||||||
JOB_DO_FORMAT_TESTING="true"
|
JOB_DO_FORMAT_TESTING="true"
|
||||||
case ${{ matrix.job.os }} in windows-latest) unset JOB_DO_FORMAT_TESTING ;; esac;
|
case ${{ matrix.job.os }} in windows-latest) unset JOB_DO_FORMAT_TESTING ;; esac;
|
||||||
echo set-output name=JOB_DO_FORMAT_TESTING::${JOB_DO_FORMAT_TESTING:-<empty>/false}
|
echo set-output name=JOB_DO_FORMAT_TESTING::${JOB_DO_FORMAT_TESTING:-<empty>/false}
|
||||||
echo ::set-output name=JOB_DO_FORMAT_TESTING::${JOB_DO_FORMAT_TESTING}
|
echo ::set-output name=JOB_DO_FORMAT_TESTING::${JOB_DO_FORMAT_TESTING}
|
||||||
# target-specific options
|
# target-specific options
|
||||||
# * CARGO_FEATURES_OPTION
|
# * CARGO_FEATURES_OPTION
|
||||||
CARGO_FEATURES_OPTION='' ;
|
CARGO_FEATURES_OPTION='' ;
|
||||||
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
|
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
|
||||||
echo set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
echo set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
||||||
echo ::set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
echo ::set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
override: true
|
override: true
|
||||||
profile: minimal # minimal component installation (ie, no documentation)
|
profile: minimal # minimal component installation (ie, no documentation)
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
- name: "`fmt` testing"
|
- name: "`fmt` testing"
|
||||||
if: steps.vars.outputs.JOB_DO_FORMAT_TESTING
|
if: steps.vars.outputs.JOB_DO_FORMAT_TESTING
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: fmt
|
command: fmt
|
||||||
args: --all -- --check
|
args: --all -- --check
|
||||||
- name: "`clippy` testing"
|
- name: "`clippy` testing"
|
||||||
if: success() || failure() # run regardless of prior step ("`fmt` testing") success/failure
|
if: success() || failure() # run regardless of prior step ("`fmt` testing") success/failure
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: clippy
|
command: clippy
|
||||||
args: ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -- -D warnings
|
args: ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -- -D warnings
|
||||||
|
|
||||||
min_version:
|
min_version:
|
||||||
name: MinSRV # Minimum supported rust version
|
name: MinSRV # Minimum supported rust version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
|
- name: Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ env.RUST_MIN_SRV }}
|
toolchain: ${{ env.RUST_MIN_SRV }}
|
||||||
profile: minimal # minimal component installation (ie, no documentation)
|
profile: minimal # minimal component installation (ie, no documentation)
|
||||||
- name: Test
|
- name: Test
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
@@ -81,188 +81,216 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
job:
|
job:
|
||||||
# { os, target, cargo-options, features, use-cross, toolchain }
|
# { os, target, cargo-options, features, use-cross, toolchain }
|
||||||
- { os: ubuntu-latest , target: aarch64-unknown-linux-gnu , use-cross: use-cross }
|
- {
|
||||||
- { os: ubuntu-latest , target: aarch64-unknown-linux-musl , use-cross: use-cross }
|
os: ubuntu-latest,
|
||||||
- { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: use-cross }
|
target: aarch64-unknown-linux-gnu,
|
||||||
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , use-cross: use-cross }
|
use-cross: use-cross,
|
||||||
- { os: ubuntu-latest , target: i686-unknown-linux-musl , use-cross: use-cross }
|
}
|
||||||
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross: use-cross }
|
- {
|
||||||
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross: use-cross }
|
os: ubuntu-latest,
|
||||||
- { os: macos-latest , target: x86_64-apple-darwin }
|
target: aarch64-unknown-linux-musl,
|
||||||
- { os: windows-latest , target: i686-pc-windows-gnu }
|
use-cross: use-cross,
|
||||||
- { os: windows-latest , target: i686-pc-windows-msvc }
|
}
|
||||||
- { os: windows-latest , target: x86_64-pc-windows-gnu } ## !maint: [rivy; 2020-01-21] may break due to rust bug; follow possible solution from GH:rust-lang/rust#47048 (refs: GH:rust-lang/rust#47048 , GH:rust-lang/rust#53454 , GH:bike-barn/hermit#172 )
|
- {
|
||||||
- { os: windows-latest , target: x86_64-pc-windows-msvc }
|
os: ubuntu-latest,
|
||||||
|
target: arm-unknown-linux-gnueabihf,
|
||||||
|
use-cross: use-cross,
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
os: ubuntu-latest,
|
||||||
|
target: i686-unknown-linux-gnu,
|
||||||
|
use-cross: use-cross,
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
os: ubuntu-latest,
|
||||||
|
target: i686-unknown-linux-musl,
|
||||||
|
use-cross: use-cross,
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
os: ubuntu-latest,
|
||||||
|
target: x86_64-unknown-linux-gnu,
|
||||||
|
use-cross: use-cross,
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
os: ubuntu-latest,
|
||||||
|
target: x86_64-unknown-linux-musl,
|
||||||
|
use-cross: use-cross,
|
||||||
|
}
|
||||||
|
- { os: macos-latest, target: x86_64-apple-darwin }
|
||||||
|
- { os: windows-latest, target: i686-pc-windows-gnu }
|
||||||
|
- { os: windows-latest, target: i686-pc-windows-msvc }
|
||||||
|
- { os: windows-latest, target: x86_64-pc-windows-gnu } ## !maint: [rivy; 2020-01-21] may break due to rust bug; follow possible solution from GH:rust-lang/rust#47048 (refs: GH:rust-lang/rust#47048 , GH:rust-lang/rust#53454 , GH:bike-barn/hermit#172 )
|
||||||
|
- { os: windows-latest, target: x86_64-pc-windows-msvc }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Install any prerequisites
|
- name: Install any prerequisites
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
case ${{ matrix.job.target }} in
|
case ${{ matrix.job.target }} in
|
||||||
arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
|
arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
|
||||||
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install binutils-aarch64-linux-gnu ;;
|
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install binutils-aarch64-linux-gnu ;;
|
||||||
esac
|
esac
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# toolchain
|
# toolchain
|
||||||
TOOLCHAIN="stable" ## default to "stable" toolchain
|
TOOLCHAIN="stable" ## default to "stable" toolchain
|
||||||
# * specify alternate TOOLCHAIN for *-pc-windows-gnu targets; gnu targets on Windows are broken for the standard *-pc-windows-msvc toolchain (refs: <https://github.com/rust-lang/rust/issues/47048>, <https://github.com/rust-lang/rust/issues/53454>, <https://github.com/rust-lang/cargo/issues/6754>)
|
# * specify alternate TOOLCHAIN for *-pc-windows-gnu targets; gnu targets on Windows are broken for the standard *-pc-windows-msvc toolchain (refs: <https://github.com/rust-lang/rust/issues/47048>, <https://github.com/rust-lang/rust/issues/53454>, <https://github.com/rust-lang/cargo/issues/6754>)
|
||||||
case ${{ matrix.job.target }} in *-pc-windows-gnu) TOOLCHAIN="stable-${{ matrix.job.target }}" ;; esac;
|
case ${{ matrix.job.target }} in *-pc-windows-gnu) TOOLCHAIN="stable-${{ matrix.job.target }}" ;; esac;
|
||||||
# * use requested TOOLCHAIN if specified
|
# * use requested TOOLCHAIN if specified
|
||||||
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
|
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
|
||||||
echo set-output name=TOOLCHAIN::${TOOLCHAIN}
|
echo set-output name=TOOLCHAIN::${TOOLCHAIN}
|
||||||
echo ::set-output name=TOOLCHAIN::${TOOLCHAIN}
|
echo ::set-output name=TOOLCHAIN::${TOOLCHAIN}
|
||||||
# staging directory
|
# staging directory
|
||||||
STAGING='_staging'
|
STAGING='_staging'
|
||||||
echo set-output name=STAGING::${STAGING}
|
echo set-output name=STAGING::${STAGING}
|
||||||
echo ::set-output name=STAGING::${STAGING}
|
echo ::set-output name=STAGING::${STAGING}
|
||||||
# determine EXE suffix
|
# determine EXE suffix
|
||||||
EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
|
EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
|
||||||
echo set-output name=EXE_suffix::${EXE_suffix}
|
echo set-output name=EXE_suffix::${EXE_suffix}
|
||||||
echo ::set-output name=EXE_suffix::${EXE_suffix}
|
echo ::set-output name=EXE_suffix::${EXE_suffix}
|
||||||
# parse commit reference info
|
# parse commit reference info
|
||||||
REF_NAME=${GITHUB_REF#refs/*/}
|
REF_NAME=${GITHUB_REF#refs/*/}
|
||||||
unset REF_BRANCH ; case ${GITHUB_REF} in refs/heads/*) REF_BRANCH=${GITHUB_REF#refs/heads/} ;; esac;
|
unset REF_BRANCH ; case ${GITHUB_REF} in refs/heads/*) REF_BRANCH=${GITHUB_REF#refs/heads/} ;; esac;
|
||||||
unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac;
|
unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac;
|
||||||
REF_SHAS=${GITHUB_SHA:0:8}
|
REF_SHAS=${GITHUB_SHA:0:8}
|
||||||
echo set-output name=REF_NAME::${REF_NAME}
|
echo set-output name=REF_NAME::${REF_NAME}
|
||||||
echo set-output name=REF_BRANCH::${REF_BRANCH}
|
echo set-output name=REF_BRANCH::${REF_BRANCH}
|
||||||
echo set-output name=REF_TAG::${REF_TAG}
|
echo set-output name=REF_TAG::${REF_TAG}
|
||||||
echo set-output name=REF_SHAS::${REF_SHAS}
|
echo set-output name=REF_SHAS::${REF_SHAS}
|
||||||
echo ::set-output name=REF_NAME::${REF_NAME}
|
echo ::set-output name=REF_NAME::${REF_NAME}
|
||||||
echo ::set-output name=REF_BRANCH::${REF_BRANCH}
|
echo ::set-output name=REF_BRANCH::${REF_BRANCH}
|
||||||
echo ::set-output name=REF_TAG::${REF_TAG}
|
echo ::set-output name=REF_TAG::${REF_TAG}
|
||||||
echo ::set-output name=REF_SHAS::${REF_SHAS}
|
echo ::set-output name=REF_SHAS::${REF_SHAS}
|
||||||
# parse target
|
# parse target
|
||||||
unset TARGET_ARCH ; case ${{ matrix.job.target }} in arm-unknown-linux-gnueabihf) TARGET_ARCH=arm ;; aarch-*) TARGET_ARCH=aarch64 ;; i686-*) TARGET_ARCH=i686 ;; x86_64-*) TARGET_ARCH=x86_64 ;; esac;
|
unset TARGET_ARCH ; case ${{ matrix.job.target }} in arm-unknown-linux-gnueabihf) TARGET_ARCH=arm ;; aarch-*) TARGET_ARCH=aarch64 ;; i686-*) TARGET_ARCH=i686 ;; x86_64-*) TARGET_ARCH=x86_64 ;; esac;
|
||||||
echo set-output name=TARGET_ARCH::${TARGET_ARCH}
|
echo set-output name=TARGET_ARCH::${TARGET_ARCH}
|
||||||
echo ::set-output name=TARGET_ARCH::${TARGET_ARCH}
|
echo ::set-output name=TARGET_ARCH::${TARGET_ARCH}
|
||||||
unset TARGET_OS ; case ${{ matrix.job.target }} in *-linux-*) TARGET_OS=linux ;; *-apple-*) TARGET_OS=macos ;; *-windows-*) TARGET_OS=windows ;; esac;
|
unset TARGET_OS ; case ${{ matrix.job.target }} in *-linux-*) TARGET_OS=linux ;; *-apple-*) TARGET_OS=macos ;; *-windows-*) TARGET_OS=windows ;; esac;
|
||||||
echo set-output name=TARGET_OS::${TARGET_OS}
|
echo set-output name=TARGET_OS::${TARGET_OS}
|
||||||
echo ::set-output name=TARGET_OS::${TARGET_OS}
|
echo ::set-output name=TARGET_OS::${TARGET_OS}
|
||||||
# package name
|
# package name
|
||||||
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
|
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
|
||||||
PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }}
|
PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }}
|
||||||
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
|
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
|
||||||
echo set-output name=PKG_suffix::${PKG_suffix}
|
echo set-output name=PKG_suffix::${PKG_suffix}
|
||||||
echo set-output name=PKG_BASENAME::${PKG_BASENAME}
|
echo set-output name=PKG_BASENAME::${PKG_BASENAME}
|
||||||
echo set-output name=PKG_NAME::${PKG_NAME}
|
echo set-output name=PKG_NAME::${PKG_NAME}
|
||||||
echo ::set-output name=PKG_suffix::${PKG_suffix}
|
echo ::set-output name=PKG_suffix::${PKG_suffix}
|
||||||
echo ::set-output name=PKG_BASENAME::${PKG_BASENAME}
|
echo ::set-output name=PKG_BASENAME::${PKG_BASENAME}
|
||||||
echo ::set-output name=PKG_NAME::${PKG_NAME}
|
echo ::set-output name=PKG_NAME::${PKG_NAME}
|
||||||
# deployable tag? (ie, leading "vM" or "M"; M == version number)
|
# deployable tag? (ie, leading "vM" or "M"; M == version number)
|
||||||
unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi
|
unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi
|
||||||
echo set-output name=DEPLOY::${DEPLOY:-<empty>/false}
|
echo set-output name=DEPLOY::${DEPLOY:-<empty>/false}
|
||||||
echo ::set-output name=DEPLOY::${DEPLOY}
|
echo ::set-output name=DEPLOY::${DEPLOY}
|
||||||
# target-specific options
|
# target-specific options
|
||||||
# * CARGO_FEATURES_OPTION
|
# * CARGO_FEATURES_OPTION
|
||||||
CARGO_FEATURES_OPTION='' ;
|
CARGO_FEATURES_OPTION='' ;
|
||||||
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
|
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
|
||||||
echo set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
echo set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
||||||
echo ::set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
echo ::set-output name=CARGO_FEATURES_OPTION::${CARGO_FEATURES_OPTION}
|
||||||
# * CARGO_USE_CROSS (truthy)
|
# * CARGO_USE_CROSS (truthy)
|
||||||
CARGO_USE_CROSS='true' ; case '${{ matrix.job.use-cross }}' in ''|0|f|false|n|no) unset CARGO_USE_CROSS ;; esac;
|
CARGO_USE_CROSS='true' ; case '${{ matrix.job.use-cross }}' in ''|0|f|false|n|no) unset CARGO_USE_CROSS ;; esac;
|
||||||
echo set-output name=CARGO_USE_CROSS::${CARGO_USE_CROSS:-<empty>/false}
|
echo set-output name=CARGO_USE_CROSS::${CARGO_USE_CROSS:-<empty>/false}
|
||||||
echo ::set-output name=CARGO_USE_CROSS::${CARGO_USE_CROSS}
|
echo ::set-output name=CARGO_USE_CROSS::${CARGO_USE_CROSS}
|
||||||
# # * `arm` cannot be tested on ubuntu-* hosts (b/c testing is currently primarily done via comparison of target outputs with built-in outputs and the `arm` target is not executable on the host)
|
# # * `arm` cannot be tested on ubuntu-* hosts (b/c testing is currently primarily done via comparison of target outputs with built-in outputs and the `arm` target is not executable on the host)
|
||||||
JOB_DO_TESTING="true"
|
JOB_DO_TESTING="true"
|
||||||
case ${{ matrix.job.target }} in arm-*|aarch64-*) unset JOB_DO_TESTING ;; esac;
|
case ${{ matrix.job.target }} in arm-*|aarch64-*) unset JOB_DO_TESTING ;; esac;
|
||||||
echo set-output name=JOB_DO_TESTING::${JOB_DO_TESTING:-<empty>/false}
|
echo set-output name=JOB_DO_TESTING::${JOB_DO_TESTING:-<empty>/false}
|
||||||
echo ::set-output name=JOB_DO_TESTING::${JOB_DO_TESTING}
|
echo ::set-output name=JOB_DO_TESTING::${JOB_DO_TESTING}
|
||||||
# # * test only binary for arm-type targets
|
# # * test only binary for arm-type targets
|
||||||
unset CARGO_TEST_OPTIONS
|
unset CARGO_TEST_OPTIONS
|
||||||
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-*|aarch64-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}" ;; esac;
|
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-*|aarch64-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}" ;; esac;
|
||||||
echo set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
echo set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
||||||
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
||||||
# * strip executable?
|
# * strip executable?
|
||||||
STRIP="strip" ; case ${{ matrix.job.target }} in arm-unknown-linux-gnueabihf) STRIP="arm-linux-gnueabihf-strip" ;; *-pc-windows-msvc) STRIP="" ;; aarch64-unknown-linux-gnu) STRIP="aarch64-linux-gnu-strip" ;; aarch64-unknown-linux-musl) STRIP="" ;;esac;
|
STRIP="strip" ; case ${{ matrix.job.target }} in arm-unknown-linux-gnueabihf) STRIP="arm-linux-gnueabihf-strip" ;; *-pc-windows-msvc) STRIP="" ;; aarch64-unknown-linux-gnu) STRIP="aarch64-linux-gnu-strip" ;; aarch64-unknown-linux-musl) STRIP="" ;;esac;
|
||||||
echo set-output name=STRIP::${STRIP}
|
echo set-output name=STRIP::${STRIP}
|
||||||
echo ::set-output name=STRIP::${STRIP}
|
echo ::set-output name=STRIP::${STRIP}
|
||||||
- name: Create all needed build/work directories
|
- name: Create all needed build/work directories
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p '${{ steps.vars.outputs.STAGING }}'
|
mkdir -p '${{ steps.vars.outputs.STAGING }}'
|
||||||
mkdir -p '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}'
|
mkdir -p '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}'
|
||||||
- name: rust toolchain ~ install
|
- name: rust toolchain ~ install
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ steps.vars.outputs.TOOLCHAIN }}
|
toolchain: ${{ steps.vars.outputs.TOOLCHAIN }}
|
||||||
target: ${{ matrix.job.target }}
|
target: ${{ matrix.job.target }}
|
||||||
override: true
|
override: true
|
||||||
profile: minimal # minimal component installation (ie, no documentation)
|
profile: minimal # minimal component installation (ie, no documentation)
|
||||||
- name: Info
|
- name: Info
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
gcc --version || true
|
gcc --version || true
|
||||||
rustup -V
|
rustup -V
|
||||||
rustup toolchain list
|
rustup toolchain list
|
||||||
rustup default
|
rustup default
|
||||||
cargo -V
|
cargo -V
|
||||||
rustc -V
|
rustc -V
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ steps.vars.outputs.CARGO_USE_CROSS }}
|
use-cross: ${{ steps.vars.outputs.CARGO_USE_CROSS }}
|
||||||
command: build
|
command: build
|
||||||
args: --release --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
args: --release --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
||||||
- name: Install cargo-deb
|
- name: Install cargo-deb
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: install
|
command: install
|
||||||
args: cargo-deb
|
args: cargo-deb
|
||||||
if: matrix.job.target == 'i686-unknown-linux-musl' || matrix.job.target == 'x86_64-unknown-linux-musl'
|
if: matrix.job.target == 'i686-unknown-linux-musl' || matrix.job.target == 'x86_64-unknown-linux-musl'
|
||||||
- name: Build deb
|
- name: Build deb
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: deb
|
command: deb
|
||||||
args: --no-build --target=${{ matrix.job.target }}
|
args: --no-build --target=${{ matrix.job.target }}
|
||||||
if: matrix.job.target == 'i686-unknown-linux-musl' || matrix.job.target == 'x86_64-unknown-linux-musl'
|
if: matrix.job.target == 'i686-unknown-linux-musl' || matrix.job.target == 'x86_64-unknown-linux-musl'
|
||||||
- name: Test
|
- name: Test
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ steps.vars.outputs.CARGO_USE_CROSS }}
|
use-cross: ${{ steps.vars.outputs.CARGO_USE_CROSS }}
|
||||||
command: test
|
command: test
|
||||||
args: --target=${{ matrix.job.target }} ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
args: --target=${{ matrix.job.target }} ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
||||||
- name: Archive executable artifacts
|
- name: Archive executable artifacts
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
|
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
|
||||||
path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
|
path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
|
||||||
- name: Archive deb artifacts
|
- name: Archive deb artifacts
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}.deb
|
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}.deb
|
||||||
path: target/${{ matrix.job.target }}/debian
|
path: target/${{ matrix.job.target }}/debian
|
||||||
if: matrix.job.target == 'i686-unknown-linux-musl' || matrix.job.target == 'x86_64-unknown-linux-musl'
|
if: matrix.job.target == 'i686-unknown-linux-musl' || matrix.job.target == 'x86_64-unknown-linux-musl'
|
||||||
- name: Package
|
- name: Package
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# binary
|
# binary
|
||||||
cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
|
cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
|
||||||
# `strip` binary (if needed)
|
# `strip` binary (if needed)
|
||||||
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' ; fi
|
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' ; fi
|
||||||
# README and LICENSE
|
# README and LICENSE
|
||||||
cp README.md '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
|
cp README.md '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
|
||||||
cp LICENSE '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
|
cp LICENSE '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
|
||||||
# base compressed package
|
# base compressed package
|
||||||
pushd '${{ steps.vars.outputs.STAGING }}/' >/dev/null
|
pushd '${{ steps.vars.outputs.STAGING }}/' >/dev/null
|
||||||
case ${{ matrix.job.target }} in
|
case ${{ matrix.job.target }} in
|
||||||
*-pc-windows-*) 7z -y a '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* | tail -2 ;;
|
*-pc-windows-*) 7z -y a '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* | tail -2 ;;
|
||||||
*) tar czf '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* ;;
|
*) tar czf '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* ;;
|
||||||
esac;
|
esac;
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: steps.vars.outputs.DEPLOY
|
if: steps.vars.outputs.DEPLOY
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
|
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
|
||||||
target/${{ matrix.job.target }}/debian/*.deb
|
target/${{ matrix.job.target }}/debian/*.deb
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
## fix! [rivy; 2020-22-01] `cargo tarpaulin` is unable to test this repo at the moment; alternate recipe or another testing framework?
|
## fix! [rivy; 2020-22-01] `cargo tarpaulin` is unable to test this repo at the moment; alternate recipe or another testing framework?
|
||||||
# coverage:
|
# coverage:
|
||||||
|
|||||||
Generated
+1
-1
@@ -197,7 +197,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "du-dust"
|
name = "du-dust"
|
||||||
version = "0.8.1"
|
version = "0.8.3-alpha1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "du-dust"
|
name = "du-dust"
|
||||||
description = "A more intuitive version of du"
|
description = "A more intuitive version of du"
|
||||||
version = "0.8.1"
|
version = "0.8.3-alpha1"
|
||||||
authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"]
|
authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/bootandy/dust)
|
[](https://travis-ci.org/bootandy/dust)
|
||||||
|
|
||||||
# Dust
|
# Dust
|
||||||
@@ -10,35 +9,37 @@ du + rust = dust. Like du but more intuitive.
|
|||||||
Because I want an easy way to see where my disk is being used.
|
Because I want an easy way to see where my disk is being used.
|
||||||
|
|
||||||
# Demo
|
# Demo
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
#### Cargo <a href="https://repology.org/project/du-dust/versions"><img src="https://repology.org/badge/vertical-allrepos/du-dust.svg" alt="Packaging status" align="right"></a>
|
#### Cargo <a href="https://repology.org/project/du-dust/versions"><img src="https://repology.org/badge/vertical-allrepos/du-dust.svg" alt="Packaging status" align="right"></a>
|
||||||
|
|
||||||
* `cargo install du-dust`
|
- `cargo install du-dust`
|
||||||
|
|
||||||
#### 🍺 Homebrew (Mac OS)
|
#### 🍺 Homebrew (Mac OS)
|
||||||
|
|
||||||
* `brew install dust`
|
- `brew install dust`
|
||||||
|
|
||||||
#### 🍺 Homebrew (Linux)
|
#### 🍺 Homebrew (Linux)
|
||||||
|
|
||||||
* `brew tap tgotwig/linux-dust && brew install dust`
|
- `brew tap tgotwig/linux-dust && brew install dust`
|
||||||
|
|
||||||
#### [Pacstall](https://github.com/pacstall/pacstall) (Debian/Ubuntu)
|
#### [Pacstall](https://github.com/pacstall/pacstall) (Debian/Ubuntu)
|
||||||
|
|
||||||
* `pacstall -I dust-bin`
|
- `pacstall -I dust-bin`
|
||||||
|
|
||||||
#### Windows:
|
#### Windows:
|
||||||
* Windows GNU version - works
|
|
||||||
* Windows MSVC - requires: [VCRUNTIME140.dll](https://docs.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist?view=msvc-170)
|
- Windows GNU version - works
|
||||||
|
- Windows MSVC - requires: [VCRUNTIME140.dll](https://docs.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist?view=msvc-170)
|
||||||
|
|
||||||
#### Download
|
#### Download
|
||||||
|
|
||||||
* Download Linux/Mac binary from [Releases](https://github.com/bootandy/dust/releases)
|
- Download Linux/Mac binary from [Releases](https://github.com/bootandy/dust/releases)
|
||||||
* unzip file: `tar -xvf _downloaded_file.tar.gz`
|
- unzip file: `tar -xvf _downloaded_file.tar.gz`
|
||||||
* move file to executable path: `sudo mv dust /usr/local/bin/`
|
- move file to executable path: `sudo mv dust /usr/local/bin/`
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -69,18 +70,17 @@ Usage: dust -f (Count files instead of diskspace)
|
|||||||
Usage: dust -t (Group by filetype)
|
Usage: dust -t (Group by filetype)
|
||||||
Usage: dust -z 10M (min-size, Only include files larger than 10M)
|
Usage: dust -z 10M (min-size, Only include files larger than 10M)
|
||||||
Usage: dust -e regex (Only include files matching this regex (eg dust -e "\.png$" would match png files))
|
Usage: dust -e regex (Only include files matching this regex (eg dust -e "\.png$" would match png files))
|
||||||
Usage: dust -v regex (Exculde files matching this regex (eg dust -v "\.png$" would ignore png files))
|
Usage: dust -v regex (Exclude files matching this regex (eg dust -v "\.png$" would ignore png files))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Alternatives
|
## Alternatives
|
||||||
|
|
||||||
* [NCDU](https://dev.yorhel.nl/ncdu)
|
- [NCDU](https://dev.yorhel.nl/ncdu)
|
||||||
* [dutree](https://github.com/nachoparker/dutree)
|
- [dutree](https://github.com/nachoparker/dutree)
|
||||||
* [dua](https://github.com/Byron/dua-cli/)
|
- [dua](https://github.com/Byron/dua-cli/)
|
||||||
* [pdu](https://github.com/KSXGitHub/parallel-disk-usage)
|
- [pdu](https://github.com/KSXGitHub/parallel-disk-usage)
|
||||||
* [dirstat-rs](https://github.com/scullionw/dirstat-rs)
|
- [dirstat-rs](https://github.com/scullionw/dirstat-rs)
|
||||||
* du -d 1 -h | sort -h
|
- du -d 1 -h | sort -h
|
||||||
|
|
||||||
Note: Apparent-size is calculated slightly differently in dust to gdu. In dust each hard link is counted as using file_length space. In gdu only the first entry is counted.
|
Note: Apparent-size is calculated slightly differently in dust to gdu. In dust each hard link is counted as using file_length space. In gdu only the first entry is counted.
|
||||||
|
|||||||
+1
-1
@@ -158,7 +158,7 @@ fn main() {
|
|||||||
rayon::ThreadPoolBuilder::new()
|
rayon::ThreadPoolBuilder::new()
|
||||||
.stack_size(usize::pow(1024, 3))
|
.stack_size(usize::pow(1024, 3))
|
||||||
.build_global()
|
.build_global()
|
||||||
.unwrap();
|
.unwrap_or_else(|e| eprintln!("Warning: Could not configure threads {:?}", e));
|
||||||
|
|
||||||
let iso = config.get_iso(&options);
|
let iso = config.get_iso(&options);
|
||||||
let (top_level_nodes, has_errors) = walk_it(simplified_dirs, walk_data);
|
let (top_level_nodes, has_errors) = walk_it(simplified_dirs, walk_data);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ static INIT: Once = Once::new();
|
|||||||
/// Copy to /tmp dir - we assume that the formatting of the /tmp partition
|
/// Copy to /tmp dir - we assume that the formatting of the /tmp partition
|
||||||
/// is consistent. If the tests fail your /tmp filesystem probably differs
|
/// is consistent. If the tests fail your /tmp filesystem probably differs
|
||||||
fn copy_test_data(dir: &str) {
|
fn copy_test_data(dir: &str) {
|
||||||
// First remove the existing directory - just incase it is there and has incorrect data
|
// First remove the existing directory - just in case it is there and has incorrect data
|
||||||
let last_slash = dir.rfind('/').unwrap();
|
let last_slash = dir.rfind('/').unwrap();
|
||||||
let last_part_of_dir = dir.chars().skip(last_slash).collect::<String>();
|
let last_part_of_dir = dir.chars().skip(last_slash).collect::<String>();
|
||||||
let _ = Command::new("rm")
|
let _ = Command::new("rm")
|
||||||
@@ -196,7 +196,7 @@ pub fn test_apparent_size() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn apparent_size_output() -> Vec<String> {
|
fn apparent_size_output() -> Vec<String> {
|
||||||
// The apparent directory sizes are too unpredictable and system dependant to try and match
|
// The apparent directory sizes are too unpredictable and system dependent to try and match
|
||||||
let files = r#"
|
let files = r#"
|
||||||
0B ┌── a_file
|
0B ┌── a_file
|
||||||
6B ├── hello_file
|
6B ├── hello_file
|
||||||
|
|||||||
Reference in New Issue
Block a user