@@ -2,10 +2,11 @@ name: GnuTests
22
33# spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem
44# spell-checker:ignore (jargon) submodules devel
5- # spell-checker:ignore (libs/utils) autopoint chksum getenforce gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e
5+ # spell-checker:ignore (libs/utils) autopoint chksum dpkg getenforce getlimits gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e
66# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
77# spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay
88# spell-checker:ignore (vars) FILESET SUBDIRS XPASS
9+ # spell-checker:ignore userns
910
1011# * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT`
1112
4243 with :
4344 path : ' uutils'
4445 persist-credentials : false
45- - name : Extract GNU version from build-gnu.sh
46- id : gnu-version
47- run : |
48- GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
49- if [ -z "$GNU_VERSION" ]; then
50- echo "Error: Failed to extract GNU version from build-gnu.sh"
51- exit 1
52- fi
53- echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
54- echo "Extracted GNU version: ${GNU_VERSION}"
5546 - uses : dtolnay/rust-toolchain@master
5647 with :
5748 toolchain : stable
@@ -60,20 +51,15 @@ jobs:
6051 with :
6152 workspaces : " ./uutils -> target"
6253 - name : Checkout code (GNU coreutils)
63- uses : actions/checkout@v6
54+ run : (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
55+ - name : Restore files for faster configure and skipping make
56+ uses : actions/cache@v5
57+ id : cache-config-gnu
6458 with :
65- repository : ' coreutils/coreutils'
66- path : ' gnu'
67- ref : ${{ env.REPO_GNU_REF }}
68- submodules : false
69- persist-credentials : false
70- - name : Override submodule URL and initialize submodules
71- # Use github instead of upstream git server
72- run : |
73- git submodule sync --recursive
74- git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
75- git submodule update --init --recursive --depth 1
76- working-directory : gnu
59+ path : |
60+ gnu/config.cache
61+ gnu/src/getlimits
62+ key : ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }} # use build-gnu.sh for extremely safe caching
7763
7864 # ### Build environment setup
7965 - name : Install dependencies
8369 sudo apt-get update
8470 ## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
8571 sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
72+ curl http://launchpadlibrarian.net/831710181/automake_1.18.1-3_all.deb > automake-1.18.deb
73+ sudo dpkg -i --force-depends automake-1.18.deb
8674 - name : Add various locales
8775 shell : bash
8876 run : |
@@ -115,11 +103,23 @@ jobs:
115103 ## Build binaries
116104 cd 'uutils'
117105 env PROFILE=release-small bash util/build-gnu.sh
106+
107+ - name : Save files for faster configure and skipping make
108+ uses : actions/cache/save@v5
109+ if : always() && steps.cache-config-gnu.outputs.cache-hit != 'true'
110+ with :
111+ path : |
112+ gnu/config.cache
113+ gnu/src/getlimits
114+ key : ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }}
118115
119116 # ## Run tests as user
120117 - name : Run GNU tests
121118 shell : bash
122119 run : |
120+ ## Use unshare
121+ sudo sysctl -w kernel.unprivileged_userns_clone=1
122+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
123123 ## Run GNU tests
124124 path_GNU='gnu'
125125 path_UUTILS='uutils'
@@ -206,16 +206,6 @@ jobs:
206206 with :
207207 path : ' uutils'
208208 persist-credentials : false
209- - name : Extract GNU version from build-gnu.sh
210- id : gnu-version-selinux
211- run : |
212- GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
213- if [ -z "$GNU_VERSION" ]; then
214- echo "Error: Failed to extract GNU version from build-gnu.sh"
215- exit 1
216- fi
217- echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
218- echo "Extracted GNU version: ${GNU_VERSION}"
219209 - uses : dtolnay/rust-toolchain@master
220210 with :
221211 toolchain : stable
@@ -224,20 +214,7 @@ jobs:
224214 with :
225215 workspaces : " ./uutils -> target"
226216 - name : Checkout code (GNU coreutils)
227- uses : actions/checkout@v6
228- with :
229- repository : ' coreutils/coreutils'
230- path : ' gnu'
231- ref : ${{ env.REPO_GNU_REF }}
232- submodules : false
233- persist-credentials : false
234- - name : Override submodule URL and initialize submodules
235- # Use github instead of upstream git server
236- run : |
237- git submodule sync --recursive
238- git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
239- git submodule update --init --recursive --depth 1
240- working-directory : gnu
217+ run : (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
241218
242219 # ### Lima build environment setup
243220 - name : Setup Lima
0 commit comments