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
497- shell : bash
498- run : |
499- ## Install dependencies
500- sudo apt-get update
501- sudo apt-get install libselinux1-dev libsystemd-dev
502- - name : " `make install`"
500+ - name : " `make install PROFILE=release-fast`"
503501 shell : bash
504502 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 : |
@@ -1277,7 +1288,6 @@ jobs:
12771288 - uses : actions/checkout@v6
12781289 with :
12791290 persist-credentials : false
1280- - uses : dtolnay/rust-toolchain@stable
12811291 - name : Setup Lima
12821292 uses : lima-vm/lima-actions/setup@v1
12831293 id : lima-actions-setup
@@ -1292,17 +1302,17 @@ jobs:
12921302 - name : Setup Rust and other build deps in VM
12931303 run : |
12941304 lima sudo dnf install gcc g++ git rustup libselinux-devel clang-devel attr -y
1295- lima rustup-init -y --default-toolchain stable
1305+ lima rustup-init -y --default-toolchain stable --profile minimal -c clippy
12961306 - name : Verify SELinux Status
12971307 run : |
12981308 lima getenforce
12991309 lima ls -laZ /etc/selinux
13001310 - name : Build and Test with SELinux
13011311 run : |
13021312 lima ls
1303- lima bash -c "cd work && cargo test --features 'feat_selinux'"
1313+ lima bash -c "cd work && cargo test --features 'feat_selinux' --no-default-features "
13041314 - name : Lint with SELinux
1305- run : lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' -- -D warnings"
1315+ run : lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' --no-default-features -- -D warnings"
13061316
13071317 test_selinux_stubs :
13081318 name : Build/SELinux-Stubs (Non-Linux)
@@ -1345,6 +1355,6 @@ jobs:
13451355 - name : Install strace
13461356 run : sudo apt-get update && sudo apt-get install -y strace
13471357 - 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
1358+ run : cargo build --profile= release-small -p uu_rm -p uu_chmod -p uu_chown -p uu_chgrp -p uu_mv -p uu_du
13491359 - name : Run safe traversal verification
13501360 run : ./util/check-safe-traversal.sh
0 commit comments