@@ -5,13 +5,13 @@ name: CICD
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
8- # spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils defconfig DESTDIR gecos getenforce gnueabihf issuecomment maint manpages msys multisize noconfirm nofeatures nullglob onexitbegin onexitend pell runtest Swatinem tempfile testsuite toybox uutils libsystemd codspeed wasip
8+ # spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils defconfig DESTDIR gecos getenforce gnueabihf issuecomment maint manpages msys multisize noconfirm nofeatures nullglob onexitbegin onexitend pell runtest Swatinem tempfile testsuite toybox uutils libsystemd codspeed
99
1010env :
1111 PROJECT_NAME : coreutils
1212 PROJECT_DESC : " Core universal (cross-platform) utilities"
1313 PROJECT_AUTH : " uutils"
14- RUST_MIN_SRV : " 1.88 .0"
14+ RUST_MIN_SRV : " 1.85 .0"
1515 # * style job configuration
1616 STYLE_FAIL_ON_FAULT : true # # (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis
1717
@@ -221,8 +221,8 @@ jobs:
221221 # dependencies
222222 echo "## dependency list"
223223 ## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
224- cargo + stable fetch --locked --quiet --target $(rustc --print host-tuple)
225- cargo + stable tree --no-dedupe --locked -e=no-dev --prefix=none ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} | grep -vE "$PWD" | sort --unique
224+ RUSTUP_TOOLCHAIN= stable cargo fetch --locked --quiet --target $(rustc --print host-tuple)
225+ RUSTUP_TOOLCHAIN= stable cargo tree --no-dedupe --locked -e=no-dev --prefix=none ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} | grep -vE "$PWD" | sort --unique
226226 - name : Test
227227 run : cargo nextest run --hide-progress-bar --profile ci ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
228228 env :
@@ -322,13 +322,13 @@ jobs:
322322 disable_search : true
323323 flags : makefile,${{ matrix.job.os }}
324324 fail_ci_if_error : false
325- - name : " `make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n`"
325+ - name : " `make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n`"
326326 shell : bash
327327 run : |
328328 set -x
329- DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n
329+ DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n
330330 # Check that utils are built with given profile
331- ./target/release-small /true
331+ ./target/release-fast /true
332332 # Check that the progs have prefix
333333 test -f /tmp/usr/local/bin/uu-tty
334334 test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.*
@@ -501,10 +501,10 @@ jobs:
501501 - uses : Swatinem/rust-cache@v2
502502 - name : Run sccache-cache
503503 uses : mozilla-actions/sccache-action@v0.0.9
504- - name : " `make install PROFILE=release`"
504+ - name : " `make install PROFILE=release-fast `"
505505 shell : bash
506506 run : |
507- export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release MANPAGES=n COMPLETIONS=n LOCALES=n
507+ export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release-fast MANPAGES=n COMPLETIONS=n LOCALES=n
508508 mkdir -p "${CARGO_TARGET_DIR}" && sudo mount -t tmpfs -o noatime,size=16G tmpfs "${CARGO_TARGET_DIR}"
509509 make install DESTDIR=target/size-release/
510510 make install COMPLETIONS=n MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
@@ -548,14 +548,14 @@ jobs:
548548 --arg multisize "$SIZE_MULTI" \
549549 '{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
550550 - name : Download the previous individual size result
551- uses : dawidd6/action-download-artifact@v14
551+ uses : dawidd6/action-download-artifact@v12
552552 with :
553553 workflow : CICD.yml
554554 name : individual-size-result
555555 repo : uutils/coreutils
556556 path : dl
557557 - name : Download the previous size result
558- uses : dawidd6/action-download-artifact@v14
558+ uses : dawidd6/action-download-artifact@v12
559559 with :
560560 workflow : CICD.yml
561561 name : size-result
@@ -630,11 +630,11 @@ jobs:
630630 - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross, skip-publish: true }
631631 - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,uudoc" , use-cross: no, workspace-tests: true }
632632 - { os: ubuntu-latest , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
633- - { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true , check-only: true }
634- - { os: ubuntu-latest , target: wasm32-wasip1 , default-features: false, features: "basenc,cksum", skip-tests: true }
633+ - { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
634+ - { os: ubuntu-latest , target: wasm32-unknown-unknown , default-features: false, features: uucore/format, skip-tests: true, skip-package: true, skip-publish : true }
635635 - { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU
636- # PR #7964: chcon should not break build without the feature. cargo check is enough to detect it .
637- - { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, check-only : true } # M1 CPU
636+ # PR #7964: Mac should still build even if the feature is not enabled. Do not publish this .
637+ - { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, skip-publish : true } # M1 CPU
638638 - { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_macos, workspace-tests: true }
639639 - { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows }
640640 - { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows }
@@ -671,6 +671,9 @@ jobs:
671671 # staging directory
672672 STAGING='_staging'
673673 outputs STAGING
674+ # determine EXE suffix
675+ EXE_suffix="" ; case '${{ matrix.job.target }}' in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
676+ outputs EXE_suffix
674677 # parse commit reference info
675678 echo GITHUB_REF=${GITHUB_REF}
676679 echo GITHUB_SHA=${GITHUB_SHA}
@@ -698,11 +701,7 @@ jobs:
698701 outputs TARGET_ARCH TARGET_OS
699702 # package name
700703 PKG_suffix=".tar.gz" ; case '${{ matrix.job.target }}' in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
701- # Some 3rd party utils need version at file names
702- # But we remove it from tag/latest-commit
703- test ${REF_TAG} \
704- && PKG_BASENAME=${PROJECT_NAME}-${REF_TAG}-${{ matrix.job.target }} \
705- || PKG_BASENAME=${PROJECT_NAME}-${{ matrix.job.target }}
704+ PKG_BASENAME=${PROJECT_NAME}-${{ matrix.job.target }}
706705 PKG_NAME=${PKG_BASENAME}${PKG_suffix}
707706 outputs PKG_suffix PKG_BASENAME PKG_NAME
708707 # deployable tag? (ie, leading "vM" or "M"; M == version number)
@@ -842,16 +841,14 @@ jobs:
842841 echo "## dependency list"
843842 cargo fetch --locked --quiet --target $(rustc --print host-tuple)
844843 cargo tree --locked --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }} --no-dedupe -e=no-dev --prefix=none | grep -vE "$PWD" | sort --unique
845- - name : Check
844+ - name : Build
846845 shell : bash
847- if : matrix.job.skip-publish != true && matrix.job.check-only == true
848846 run : |
849- # expr breaks redox
850- sed -i.b '/"expr",/d' Cargo.toml
851- ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} check \
847+ ## Build
848+ ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \
852849 --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
853850 - name : Test
854- if : matrix.job.skip-tests != true && matrix.job.check-only != true
851+ if : matrix.job.skip-tests != true
855852 shell : bash
856853 run : |
857854 ## Test
@@ -860,29 +857,19 @@ jobs:
860857 ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }} -p coreutils
861858 env :
862859 RUST_BACKTRACE : " 1"
863- - name : Build coreutils
864- shell : bash
865- if : matrix.job.skip-publish != true && matrix.job.check-only != true && matrix.job.target != 'x86_64-pc-windows-msvc'
866- run : |
867- ## Build
868- ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \
869- --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
870- # We don't want to have many duplicated long jobs at here
871- # So we build individual binaries for few platforms until we deduplicate many release build for Linux
872- - name : Build individual binaries
873- if : matrix.job.skip-tests != true && matrix.job.target == 'x86_64-pc-windows-msvc'
874- shell : bash
875- run : |
876- ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \
877- --target=${{ matrix.job.target }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
860+ - name : Archive executable artifacts
861+ uses : actions/upload-artifact@v6
862+ with :
863+ name : ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}${{ steps.vars.outputs.ARTIFACTS_SUFFIX }}
864+ path : target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
878865 - name : Package
879- if : matrix.job.skip-publish != true && matrix.job.check-only != true
866+ if : matrix.job.skip-package != true
880867 shell : bash
881868 run : |
882869 ## Package artifact(s)
883- find target/${{ matrix.job.target }}/release -maxdepth 1 -type f \
884- \( -name "*.wasm" -o -name "*.exe" -o -perm -u+x \) \
885- -exec ln -v {} " ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/" \;
870+ # binaries
871+ cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
872+ cp 'target/${{ matrix.job.target }}/release/uudoc${{ steps.vars.outputs.EXE_suffix }}' ' ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/' || :
886873 # README and LICENSE
887874 # * spell-checker:ignore EADME ICENSE
888875 (shopt -s nullglob; for f in [R]"EADME"{,.*}; do cp $f '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/' ; done)
@@ -910,7 +897,7 @@ jobs:
910897 tar --zstd -cf docs.tar.zst share
911898 - name : Publish
912899 uses : softprops/action-gh-release@v2
913- if : steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true && matrix.job.check-only != true
900+ if : steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true
914901 with :
915902 draft : true
916903 files : |
@@ -920,11 +907,9 @@ jobs:
920907 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
921908 - name : Publish latest commit
922909 uses : softprops/action-gh-release@v2
923- if : github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.job.skip-publish != true && matrix.job.check-only != true
910+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.job.skip-publish != true
924911 with :
925912 tag_name : latest-commit
926- body : |
927- commit: ${{ github.sha }}
928913 draft : false
929914 prerelease : true
930915 files : |
@@ -1240,8 +1225,7 @@ jobs:
12401225 fail_ci_if_error : false
12411226
12421227 test_separately :
1243- # duplicated with other CI, but has better appearance
1244- name : Separate Builds (individual and coreutils)
1228+ name : Separate Builds (individual and coreutils)# duplicated with other CI, but has better appearance
12451229 runs-on : ${{ matrix.job.os }}
12461230 strategy :
12471231 fail-fast : false
@@ -1326,9 +1310,8 @@ jobs:
13261310 run : |
13271311 test -f target/debug/chcon || test -f target/debug/chcon.exe
13281312 test -f target/debug/runcon || test -f target/debug/runcon.exe
1329- # check is enough to detect workspace breakage by chcon
13301313 - name : Verify workspace builds with stubs
1331- run : cargo check --features ${{ matrix.job.features }}
1314+ run : cargo build --features ${{ matrix.job.features }}
13321315
13331316 test_safe_traversal :
13341317 name : Safe Traversal Security Check
0 commit comments