mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
commit
c996dc8bac
3 changed files with 70 additions and 29 deletions
68
.github/workflows/CICD.yml
vendored
68
.github/workflows/CICD.yml
vendored
|
@ -1,11 +1,11 @@
|
||||||
name: CICD
|
name: CICD
|
||||||
|
|
||||||
# spell-checker:ignore (acronyms) CICD MSVC musl
|
# spell-checker:ignore (abbrev/names) CICD CodeCOV MacOS MinGW MSVC musl
|
||||||
# spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic
|
# spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic
|
||||||
# spell-checker:ignore (jargon) SHAs deps dequote softprops subshell toolchain
|
# spell-checker:ignore (jargon) SHAs deps dequote softprops subshell toolchain
|
||||||
# spell-checker:ignore (names) CodeCOV MacOS MinGW Peltoche rivy
|
# spell-checker:ignore (people) Peltoche rivy
|
||||||
# spell-checker:ignore (shell/tools) choco clippy dmake dpkg esac fakeroot gmake grcov halium lcov libssl mkdir popd printf pushd rsync rustc rustfmt rustup shopt xargs
|
# spell-checker:ignore (shell/tools) choco clippy dmake dpkg esac fakeroot fdesc fdescfs gmake grcov halium lcov libssl mkdir popd printf pushd rsync rustc rustfmt rustup shopt utmpdump xargs
|
||||||
# spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils gnueabihf issuecomment maint nullglob onexitbegin onexitend pell runtest tempfile testsuite uutils DESTDIR multisize Swatinem
|
# spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils defconfig DESTDIR gecos gnueabihf issuecomment maint multisize nullglob onexitbegin onexitend pell runtest Swatinem tempfile testsuite toybox uutils
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PROJECT_NAME: coreutils
|
PROJECT_NAME: coreutils
|
||||||
|
@ -50,7 +50,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# failure mode
|
# failure mode
|
||||||
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
||||||
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
||||||
|
@ -102,7 +102,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# failure mode
|
# failure mode
|
||||||
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
||||||
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
||||||
|
@ -116,6 +116,7 @@ jobs:
|
||||||
outputs CARGO_FEATURES_OPTION
|
outputs CARGO_FEATURES_OPTION
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
||||||
rustup toolchain install stable -c rustfmt --profile minimal
|
rustup toolchain install stable -c rustfmt --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
@ -150,7 +151,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# failure mode
|
# failure mode
|
||||||
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
||||||
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
||||||
|
@ -170,11 +171,13 @@ jobs:
|
||||||
- name: Install/setup prerequisites
|
- name: Install/setup prerequisites
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Install/setup prerequisites
|
||||||
case '${{ matrix.job.os }}' in
|
case '${{ matrix.job.os }}' in
|
||||||
macos-latest) brew install coreutils ;; # needed for show-utils.sh
|
macos-latest) brew install coreutils ;; # needed for show-utils.sh
|
||||||
esac
|
esac
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install stable -c clippy --profile minimal
|
rustup toolchain install stable -c clippy --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -206,7 +209,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# failure mode
|
# failure mode
|
||||||
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
||||||
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
||||||
|
@ -257,7 +260,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# failure mode
|
# failure mode
|
||||||
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
|
||||||
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
|
||||||
|
@ -276,6 +279,7 @@ jobs:
|
||||||
outputs CARGO_UTILITY_LIST_OPTIONS
|
outputs CARGO_UTILITY_LIST_OPTIONS
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install stable -c clippy --profile minimal
|
rustup toolchain install stable -c clippy --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -299,7 +303,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# target-specific options
|
# target-specific options
|
||||||
# * CARGO_FEATURES_OPTION
|
# * CARGO_FEATURES_OPTION
|
||||||
unset CARGO_FEATURES_OPTION
|
unset CARGO_FEATURES_OPTION
|
||||||
|
@ -307,6 +311,7 @@ jobs:
|
||||||
outputs CARGO_FEATURES_OPTION
|
outputs CARGO_FEATURES_OPTION
|
||||||
- name: Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
|
- name: Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain (v${{ env.RUST_MIN_SRV }})
|
||||||
rustup toolchain install ${{ env.RUST_MIN_SRV }} --profile minimal
|
rustup toolchain install ${{ env.RUST_MIN_SRV }} --profile minimal
|
||||||
rustup default ${{ env.RUST_MIN_SRV }}
|
rustup default ${{ env.RUST_MIN_SRV }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -361,6 +366,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install stable --profile minimal
|
rustup toolchain install stable --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -384,6 +390,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install stable --profile minimal
|
rustup toolchain install stable --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -415,6 +422,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install stable --profile minimal
|
rustup toolchain install stable --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -439,6 +447,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install nightly --profile minimal
|
rustup toolchain install nightly --profile minimal
|
||||||
rustup default nightly
|
rustup default nightly
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -466,26 +475,29 @@ jobs:
|
||||||
sudo apt-get install jq
|
sudo apt-get install jq
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rustup toolchain install stable --profile minimal
|
rustup toolchain install stable --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: "`make install`"
|
- name: "`make install`"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## `make install`
|
||||||
make install DESTDIR=target/size-release/
|
make install DESTDIR=target/size-release/
|
||||||
make install MULTICALL=y DESTDIR=target/size-multi-release/
|
make install MULTICALL=y DESTDIR=target/size-multi-release/
|
||||||
# strip the results
|
# strip the results
|
||||||
strip target/size*/usr/local/bin/*
|
strip target/size*/usr/local/bin/*
|
||||||
- name: "Compute sizes"
|
- name: Compute uutil release sizes
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Compute uutil release sizes
|
||||||
SIZE=$(du -s target/size-release/usr/local/bin/|awk '{print $1}')
|
SIZE=$(du -s target/size-release/usr/local/bin/|awk '{print $1}')
|
||||||
SIZEMULTI=$(du -s target/size-multi-release/usr/local/bin/|awk '{print $1}')
|
SIZE_MULTI=$(du -s target/size-multi-release/usr/local/bin/|awk '{print $1}')
|
||||||
jq -n \
|
jq -n \
|
||||||
--arg date "$(date --rfc-email)" \
|
--arg date "$(date --rfc-email)" \
|
||||||
--arg sha "$GITHUB_SHA" \
|
--arg sha "$GITHUB_SHA" \
|
||||||
--arg size "$SIZE" \
|
--arg size "$SIZE" \
|
||||||
--arg multisize "$SIZEMULTI" \
|
--arg multisize "$SIZE_MULTI" \
|
||||||
'{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
|
'{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -533,7 +545,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# toolchain
|
# toolchain
|
||||||
TOOLCHAIN="stable" ## default to "stable" toolchain
|
TOOLCHAIN="stable" ## default to "stable" toolchain
|
||||||
# * specify alternate/non-default TOOLCHAIN for *-pc-windows-gnu targets; gnu targets on Windows are broken for the standard *-pc-windows-msvc toolchain (refs: GH:rust-lang/rust#47048, GH:rust-lang/rust#53454, GH:rust-lang/cargo#6754)
|
# * specify alternate/non-default TOOLCHAIN for *-pc-windows-gnu targets; gnu targets on Windows are broken for the standard *-pc-windows-msvc toolchain (refs: GH:rust-lang/rust#47048, GH:rust-lang/rust#53454, GH:rust-lang/cargo#6754)
|
||||||
|
@ -553,7 +565,7 @@ jobs:
|
||||||
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:10}
|
||||||
outputs REF_NAME REF_BRANCH REF_TAG REF_SHAS
|
outputs REF_NAME REF_BRANCH REF_TAG REF_SHAS
|
||||||
# parse target
|
# parse target
|
||||||
unset TARGET_ARCH
|
unset TARGET_ARCH
|
||||||
|
@ -652,6 +664,7 @@ jobs:
|
||||||
esac
|
esac
|
||||||
- name: rust toolchain ~ install
|
- name: rust toolchain ~ install
|
||||||
run: |
|
run: |
|
||||||
|
## rust toolchain ~ install
|
||||||
rustup toolchain install ${{ env.RUST_MIN_SRV }} -t ${{ matrix.job.target }} --profile minimal
|
rustup toolchain install ${{ env.RUST_MIN_SRV }} -t ${{ matrix.job.target }} --profile minimal
|
||||||
rustup default ${{ env.RUST_MIN_SRV }}
|
rustup default ${{ env.RUST_MIN_SRV }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -662,7 +675,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## Dependent VARs setup
|
## Dependent VARs setup
|
||||||
outputs() { step_id="dep_vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# * determine sub-crate utility list
|
# * determine sub-crate utility list
|
||||||
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
|
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
|
||||||
echo UTILITY_LIST=${UTILITY_LIST}
|
echo UTILITY_LIST=${UTILITY_LIST}
|
||||||
|
@ -694,11 +707,13 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Build
|
||||||
${{ steps.vars.outputs.CARGO_CMD }} +${{ env.RUST_MIN_SRV }} build --release \
|
${{ steps.vars.outputs.CARGO_CMD }} +${{ env.RUST_MIN_SRV }} build --release \
|
||||||
--target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
--target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
||||||
- name: Test
|
- name: Test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Test
|
||||||
${{ steps.vars.outputs.CARGO_CMD }} +${{ env.RUST_MIN_SRV }} test --target=${{ matrix.job.target }} \
|
${{ steps.vars.outputs.CARGO_CMD }} +${{ env.RUST_MIN_SRV }} test --target=${{ matrix.job.target }} \
|
||||||
${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
|
||||||
env:
|
env:
|
||||||
|
@ -706,6 +721,7 @@ jobs:
|
||||||
- name: Test individual utilities
|
- name: Test individual utilities
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Test individual utilities
|
||||||
${{ steps.vars.outputs.CARGO_CMD }} +${{ env.RUST_MIN_SRV }} test --target=${{ matrix.job.target }} \
|
${{ steps.vars.outputs.CARGO_CMD }} +${{ env.RUST_MIN_SRV }} test --target=${{ matrix.job.target }} \
|
||||||
${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
|
${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
|
||||||
env:
|
env:
|
||||||
|
@ -782,10 +798,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
## Install/setup prerequisites
|
## Install/setup prerequisites
|
||||||
make prepare-busytest
|
make prepare-busytest
|
||||||
- name: "Run BusyBox test suite"
|
- name: Run BusyBox test suite
|
||||||
id: summary
|
id: summary
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Run BusyBox test suite
|
||||||
set -v
|
set -v
|
||||||
cp .busybox-config target/debug/.config
|
cp .busybox-config target/debug/.config
|
||||||
## Run BusyBox test suite
|
## Run BusyBox test suite
|
||||||
|
@ -846,16 +863,20 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
echo "TEST_SUMMARY_FILE=toybox-result.json" >> $GITHUB_OUTPUT
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
|
TEST_SUMMARY_FILE="toybox-result.json"
|
||||||
|
outputs TEST_SUMMARY_FILE
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: rust toolchain ~ install
|
- name: rust toolchain ~ install
|
||||||
run: |
|
run: |
|
||||||
|
## rust toolchain ~ install
|
||||||
rustup toolchain install ${{ env.RUST_MIN_SRV }} --profile minimal
|
rustup toolchain install ${{ env.RUST_MIN_SRV }} --profile minimal
|
||||||
rustup default ${{ env.RUST_MIN_SRV }}
|
rustup default ${{ env.RUST_MIN_SRV }}
|
||||||
- name: "Build coreutils as multiple binaries"
|
- name: Build coreutils as multiple binaries
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Build individual uutil binaries
|
||||||
set -v
|
set -v
|
||||||
make
|
make
|
||||||
- name: Install/setup prerequisites
|
- name: Install/setup prerequisites
|
||||||
|
@ -863,12 +884,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
## Install/setup prerequisites
|
## Install/setup prerequisites
|
||||||
make toybox-src
|
make toybox-src
|
||||||
- name: "Run Toybox test suite"
|
- name: Run Toybox test suite
|
||||||
id: summary
|
id: summary
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -v
|
|
||||||
## Run Toybox test suite
|
## Run Toybox test suite
|
||||||
|
set -v
|
||||||
cd tmp/toybox-*/
|
cd tmp/toybox-*/
|
||||||
make defconfig
|
make defconfig
|
||||||
make tests &> tmp.log || true
|
make tests &> tmp.log || true
|
||||||
|
@ -1062,7 +1083,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# toolchain
|
# toolchain
|
||||||
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
|
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
|
||||||
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
|
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
|
||||||
|
@ -1105,6 +1126,7 @@ jobs:
|
||||||
esac
|
esac
|
||||||
- name: rust toolchain ~ install
|
- name: rust toolchain ~ install
|
||||||
run: |
|
run: |
|
||||||
|
## rust toolchain ~ install
|
||||||
rustup toolchain install ${{ steps.vars.outputs.TOOLCHAIN }} --profile minimal
|
rustup toolchain install ${{ steps.vars.outputs.TOOLCHAIN }} --profile minimal
|
||||||
rustup default ${{ steps.vars.outputs.TOOLCHAIN }}
|
rustup default ${{ steps.vars.outputs.TOOLCHAIN }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -1113,7 +1135,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## Dependent VARs setup
|
## Dependent VARs setup
|
||||||
outputs() { step_id="dep_vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# * determine sub-crate utility list
|
# * determine sub-crate utility list
|
||||||
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
|
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
|
||||||
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
|
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
|
||||||
|
|
6
.github/workflows/FixPR.yml
vendored
6
.github/workflows/FixPR.yml
vendored
|
@ -32,12 +32,13 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# surface MSRV from CICD workflow
|
# surface MSRV from CICD workflow
|
||||||
RUST_MIN_SRV=$(grep -P "^\s+RUST_MIN_SRV:" .github/workflows/CICD.yml | grep -Po "(?<=\x22)\d+[.]\d+(?:[.]\d+)?(?=\x22)" )
|
RUST_MIN_SRV=$(grep -P "^\s+RUST_MIN_SRV:" .github/workflows/CICD.yml | grep -Po "(?<=\x22)\d+[.]\d+(?:[.]\d+)?(?=\x22)" )
|
||||||
outputs RUST_MIN_SRV
|
outputs RUST_MIN_SRV
|
||||||
- name: Install `rust` toolchain (v${{ steps.vars.outputs.RUST_MIN_SRV }})
|
- name: Install `rust` toolchain (v${{ steps.vars.outputs.RUST_MIN_SRV }})
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain (v${{ steps.vars.outputs.RUST_MIN_SRV }})
|
||||||
rustup toolchain install ${{ steps.vars.outputs.RUST_MIN_SRV }} --profile minimal
|
rustup toolchain install ${{ steps.vars.outputs.RUST_MIN_SRV }} --profile minimal
|
||||||
rustup default ${{ steps.vars.outputs.RUST_MIN_SRV }}
|
rustup default ${{ steps.vars.outputs.RUST_MIN_SRV }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -94,7 +95,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# target-specific options
|
# target-specific options
|
||||||
# * CARGO_FEATURES_OPTION
|
# * CARGO_FEATURES_OPTION
|
||||||
CARGO_FEATURES_OPTION='' ;
|
CARGO_FEATURES_OPTION='' ;
|
||||||
|
@ -102,6 +103,7 @@ jobs:
|
||||||
outputs CARGO_FEATURES_OPTION
|
outputs CARGO_FEATURES_OPTION
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
||||||
rustup toolchain install stable -c rustfmt --profile minimal
|
rustup toolchain install stable -c rustfmt --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
|
25
.github/workflows/GnuTests.yml
vendored
25
.github/workflows/GnuTests.yml
vendored
|
@ -1,6 +1,11 @@
|
||||||
name: GnuTests
|
name: GnuTests
|
||||||
|
|
||||||
# spell-checker:ignore (names) gnulib ; (jargon) submodules ; (people) Dawid Dziurla * dawidd ; (utils) autopoint chksum gperf pyinotify shopt texinfo ; (vars) FILESET SUBDIRS XPASS
|
# spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests
|
||||||
|
# spell-checker:ignore (jargon) submodules
|
||||||
|
# spell-checker:ignore (libs/utils) autopoint chksum gperf lcov libexpect pyinotify shopt texinfo valgrind
|
||||||
|
# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
|
||||||
|
# spell-checker:ignore (people) Dawid Dziurla * dawidd
|
||||||
|
# spell-checker:ignore (vars) FILESET SUBDIRS XPASS
|
||||||
|
|
||||||
# * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT`
|
# * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT`
|
||||||
|
|
||||||
|
@ -23,7 +28,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
## VARs setup
|
## VARs setup
|
||||||
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
# * config
|
# * config
|
||||||
path_GNU="gnu"
|
path_GNU="gnu"
|
||||||
path_GNU_tests="${path_GNU}/tests"
|
path_GNU_tests="${path_GNU}/tests"
|
||||||
|
@ -67,6 +72,7 @@ jobs:
|
||||||
path: "${{ steps.vars.outputs.path_reference }}"
|
path: "${{ steps.vars.outputs.path_reference }}"
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
||||||
rustup toolchain install stable -c rustfmt --profile minimal
|
rustup toolchain install stable -c rustfmt --profile minimal
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
@ -79,6 +85,7 @@ jobs:
|
||||||
- name: Add various locales
|
- name: Add various locales
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Add various locales
|
||||||
echo "Before:"
|
echo "Before:"
|
||||||
locale -a
|
locale -a
|
||||||
## Some tests fail with 'cannot change locale (en_US.ISO-8859-1): No such file or directory'
|
## Some tests fail with 'cannot change locale (en_US.ISO-8859-1): No such file or directory'
|
||||||
|
@ -103,27 +110,31 @@ jobs:
|
||||||
- name: Run GNU tests
|
- name: Run GNU tests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Run GNU tests
|
||||||
path_GNU='${{ steps.vars.outputs.path_GNU }}'
|
path_GNU='${{ steps.vars.outputs.path_GNU }}'
|
||||||
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
||||||
bash "${path_UUTILS}/util/run-gnu-test.sh"
|
bash "${path_UUTILS}/util/run-gnu-test.sh"
|
||||||
- name: Run GNU root tests
|
- name: Run GNU root tests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Run GNU root tests
|
||||||
path_GNU='${{ steps.vars.outputs.path_GNU }}'
|
path_GNU='${{ steps.vars.outputs.path_GNU }}'
|
||||||
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
||||||
bash "${path_UUTILS}/util/run-gnu-test.sh" run-root
|
bash "${path_UUTILS}/util/run-gnu-test.sh" run-root
|
||||||
- name: Extract testing info into JSON
|
- name: Extract testing info into JSON
|
||||||
shell: bash
|
shell: bash
|
||||||
run : |
|
run : |
|
||||||
|
## Extract testing info into JSON
|
||||||
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
||||||
python ${path_UUTILS}/util/gnu-json-result.py ${{ steps.vars.outputs.path_GNU_tests }} > ${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE }}
|
python ${path_UUTILS}/util/gnu-json-result.py ${{ steps.vars.outputs.path_GNU_tests }} > ${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE }}
|
||||||
- name: Extract/summarize testing info
|
- name: Extract/summarize testing info
|
||||||
id: summary
|
id: summary
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
|
||||||
## Extract/summarize testing info
|
## Extract/summarize testing info
|
||||||
outputs() { step_id="summary"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
|
#
|
||||||
|
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
||||||
#
|
#
|
||||||
SUITE_LOG_FILE='${{ steps.vars.outputs.SUITE_LOG_FILE }}'
|
SUITE_LOG_FILE='${{ steps.vars.outputs.SUITE_LOG_FILE }}'
|
||||||
ROOT_SUITE_LOG_FILE='${{ steps.vars.outputs.ROOT_SUITE_LOG_FILE }}'
|
ROOT_SUITE_LOG_FILE='${{ steps.vars.outputs.ROOT_SUITE_LOG_FILE }}'
|
||||||
|
@ -180,6 +191,7 @@ jobs:
|
||||||
- name: Compare test failures VS reference
|
- name: Compare test failures VS reference
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Compare test failures VS reference
|
||||||
have_new_failures=""
|
have_new_failures=""
|
||||||
REF_LOG_FILE='${{ steps.vars.outputs.path_reference }}/test-logs/test-suite.log'
|
REF_LOG_FILE='${{ steps.vars.outputs.path_reference }}/test-logs/test-suite.log'
|
||||||
REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json'
|
REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json'
|
||||||
|
@ -254,6 +266,7 @@ jobs:
|
||||||
if: success() || failure() # run regardless of prior step success/failure
|
if: success() || failure() # run regardless of prior step success/failure
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
## Compare test summary VS reference
|
||||||
REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json'
|
REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json'
|
||||||
if test -f "${REF_SUMMARY_FILE}"; then
|
if test -f "${REF_SUMMARY_FILE}"; then
|
||||||
echo "Reference SHA1/ID: $(sha1sum -- "${REF_SUMMARY_FILE}")"
|
echo "Reference SHA1/ID: $(sha1sum -- "${REF_SUMMARY_FILE}")"
|
||||||
|
@ -280,15 +293,18 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
run: |
|
run: |
|
||||||
|
## Install `rust` toolchain
|
||||||
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}
|
||||||
rustup toolchain install nightly -c rustfmt --profile minimal
|
rustup toolchain install nightly -c rustfmt --profile minimal
|
||||||
rustup default nightly
|
rustup default nightly
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
## Install dependencies
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl -y
|
sudo apt install autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl -y
|
||||||
- name: Add various locales
|
- name: Add various locales
|
||||||
run: |
|
run: |
|
||||||
|
## Add various locales
|
||||||
echo "Before:"
|
echo "Before:"
|
||||||
locale -a
|
locale -a
|
||||||
## Some tests fail with 'cannot change locale (en_US.ISO-8859-1): No such file or directory'
|
## Some tests fail with 'cannot change locale (en_US.ISO-8859-1): No such file or directory'
|
||||||
|
@ -305,6 +321,7 @@ jobs:
|
||||||
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
||||||
RUSTDOCFLAGS: "-Cpanic=abort"
|
RUSTDOCFLAGS: "-Cpanic=abort"
|
||||||
run: |
|
run: |
|
||||||
|
## Build binaries
|
||||||
cd uutils
|
cd uutils
|
||||||
UU_MAKE_PROFILE=debug bash util/build-gnu.sh
|
UU_MAKE_PROFILE=debug bash util/build-gnu.sh
|
||||||
- name: Run GNU tests
|
- name: Run GNU tests
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue