11name : CICD
22
33# spell-checker:ignore (abbrev/names) CACHEDIR CICD CodeCOV MacOS MinGW MSVC musl taiki
4- # spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic CARGOFLAGS
4+ # spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic CARGOFLAGS CLEVEL
55# spell-checker:ignore (jargon) SHAs deps dequote softprops subshell toolchain fuzzers dedupe devel profdata
66# spell-checker:ignore (people) Peltoche rivy dtolnay Anson dawidd
77# spell-checker:ignore (shell/tools) binutils choco clippy dmake esac fakeroot fdesc fdescfs gmake grcov halium lcov libclang libfuse libssl limactl mkdir nextest nocross pacman popd printf pushd redoxer rsync rustc rustfmt rustup shopt sccache utmpdump xargs zstd
@@ -298,6 +298,8 @@ jobs:
298298 fi
299299 # Check that we don't cross-build uudoc
300300 env CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu make install-manpages PREFIX=/tmp/usr UTILS=true
301+ # We don't build coreutils without MULTICALL=y
302+ ! test -e target/debug/coreutils
301303 # build (host)
302304 make build
303305 echo "Check that target directory will be ignored by backup tools"
@@ -477,6 +479,8 @@ jobs:
477479 name : Binary sizes
478480 needs : [ min_version, deps ]
479481 runs-on : ${{ matrix.job.os }}
482+ permissions :
483+ contents : write
480484 env :
481485 SCCACHE_GHA_ENABLED : " true"
482486 RUSTC_WRAPPER : " sccache"
@@ -493,18 +497,25 @@ jobs:
493497 - uses : Swatinem/rust-cache@v2
494498 - name : Run sccache-cache
495499 uses : mozilla-actions/sccache-action@v0.0.9
496- - name : Install dependencies
500+ - name : " `make install PROFILE=release-fast` "
497501 shell : bash
498502 run : |
499- ## Install dependencies
500- sudo apt-get update
501- sudo apt-get install libselinux1-dev libsystemd-dev
502- - name : " `make install`"
503- shell : bash
504- run : |
505- ## `make install`
506- RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" make install DESTDIR=target/size-release/
507- RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" make install MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
503+ export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release-fast MANPAGES=n COMPLETIONS=n LOCALES=n
504+ mkdir -p "${CARGO_TARGET_DIR}" && sudo mount -t tmpfs -o noatime,size=16G tmpfs "${CARGO_TARGET_DIR}"
505+ make install DESTDIR=target/size-release/
506+ make install COMPLETIONS=n MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
507+ ZSTD_CLEVEL=19 tar --zstd -caf individual-x86_64-unknown-linux-gnu.tar.zst -C target/size-release/usr/local bin
508+ - name : Publish
509+ uses : softprops/action-gh-release@v2
510+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
511+ with :
512+ tag_name : latest-commit
513+ draft : false
514+ prerelease : true
515+ files : |
516+ individual-x86_64-unknown-linux-gnu.tar.zst
517+ env :
518+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
508519 - name : Test for hardlinks
509520 shell : bash
510521 run : |
@@ -837,16 +848,8 @@ jobs:
837848 run : |
838849 ## Test
839850 ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} test --target=${{ matrix.job.target }} \
840- ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
841- env :
842- RUST_BACKTRACE : " 1"
843- - name : Test individual utilities
844- if : matrix.job.skip-tests != true
845- shell : bash
846- run : |
847- ## Test individual utilities
848- ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} test --target=${{ matrix.job.target }} \
849- ${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
851+ ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }} \
852+ ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }} -p coreutils
850853 env :
851854 RUST_BACKTRACE : " 1"
852855 - name : Archive executable artifacts
@@ -1277,7 +1280,6 @@ jobs:
12771280 - uses : actions/checkout@v6
12781281 with :
12791282 persist-credentials : false
1280- - uses : dtolnay/rust-toolchain@stable
12811283 - name : Setup Lima
12821284 uses : lima-vm/lima-actions/setup@v1
12831285 id : lima-actions-setup
@@ -1292,17 +1294,17 @@ jobs:
12921294 - name : Setup Rust and other build deps in VM
12931295 run : |
12941296 lima sudo dnf install gcc g++ git rustup libselinux-devel clang-devel attr -y
1295- lima rustup-init -y --default-toolchain stable
1297+ lima rustup-init -y --default-toolchain stable --profile minimal -c clippy
12961298 - name : Verify SELinux Status
12971299 run : |
12981300 lima getenforce
12991301 lima ls -laZ /etc/selinux
13001302 - name : Build and Test with SELinux
13011303 run : |
13021304 lima ls
1303- lima bash -c "cd work && cargo test --features 'feat_selinux'"
1305+ lima bash -c "cd work && cargo test --features 'feat_selinux' --no-default-features "
13041306 - name : Lint with SELinux
1305- run : lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' -- -D warnings"
1307+ run : lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' --no-default-features -- -D warnings"
13061308
13071309 test_selinux_stubs :
13081310 name : Build/SELinux-Stubs (Non-Linux)
@@ -1345,6 +1347,6 @@ jobs:
13451347 - name : Install strace
13461348 run : sudo apt-get update && sudo apt-get install -y strace
13471349 - name : Build utilities with safe traversal
1348- run : cargo build --release -p uu_rm -p uu_chmod -p uu_chown -p uu_chgrp -p uu_mv -p uu_du
1350+ run : cargo build --profile= release-small -p uu_rm -p uu_chmod -p uu_chown -p uu_chgrp -p uu_mv -p uu_du
13491351 - name : Run safe traversal verification
13501352 run : ./util/check-safe-traversal.sh
0 commit comments