@@ -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
2728 DEFAULT_BRANCH : ${{ github.event.repository.default_branch }}
2829 TEST_FULL_SUMMARY_FILE : ' gnu-full-result.json'
2930 TEST_ROOT_FULL_SUMMARY_FILE : ' gnu-root-full-result.json'
31+ TEST_STTY_FULL_SUMMARY_FILE : ' gnu-stty-full-result.json'
3032 TEST_SELINUX_FULL_SUMMARY_FILE : ' selinux-gnu-full-result.json'
3133 TEST_SELINUX_ROOT_FULL_SUMMARY_FILE : ' selinux-root-gnu-full-result.json'
32- REPO_GNU_REF : " v9.8"
3334
3435jobs :
3536 native :
3839 steps :
3940 # ### Get the code, setup cache
4041 - name : Checkout code (uutils)
41- uses : actions/checkout@v5
42+ uses : actions/checkout@v6
4243 with :
4344 path : ' uutils'
4445 persist-credentials : false
@@ -50,28 +51,26 @@ jobs:
5051 with :
5152 workspaces : " ./uutils -> target"
5253 - name : Checkout code (GNU coreutils)
53- uses : actions/checkout@v5
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
5458 with :
55- repository : ' coreutils/coreutils'
56- path : ' gnu'
57- ref : ${{ env.REPO_GNU_REF }}
58- submodules : false
59- persist-credentials : false
60- - name : Override submodule URL and initialize submodules
61- # Use github instead of upstream git server
62- run : |
63- git submodule sync --recursive
64- git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
65- git submodule update --init --recursive --depth 1
66- 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
6763
6864 # ### Build environment setup
6965 - name : Install dependencies
7066 shell : bash
7167 run : |
7268 ## Install dependencies
7369 sudo apt-get update
74- sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt
70+ ## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
71+ 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
7574 - name : Add various locales
7675 shell : bash
7776 run : |
8988 sudo locale-gen --keep-existing en_US
9089 sudo locale-gen --keep-existing en_US.UTF-8
9190 sudo locale-gen --keep-existing ru_RU.KOI8-R
91+ sudo locale-gen --keep-existing fa_IR.UTF-8 # Iran
92+ sudo locale-gen --keep-existing am_ET.UTF-8 # Ethiopia
93+ sudo locale-gen --keep-existing th_TH.UTF-8 # Thailand
94+ sudo locale-gen --keep-existing zh_CN.GB18030 # China
9295
9396 sudo update-locale
9497 echo "After:"
@@ -100,12 +103,24 @@ jobs:
100103 run : |
101104 ## Build binaries
102105 cd 'uutils'
103- bash util/build-gnu.sh --release-build
106+ env PROFILE=release-small bash util/build-gnu.sh
107+
108+ - name : Save files for faster configure and skipping make
109+ uses : actions/cache/save@v5
110+ if : always() && steps.cache-config-gnu.outputs.cache-hit != 'true'
111+ with :
112+ path : |
113+ gnu/config.cache
114+ gnu/src/getlimits
115+ key : ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }}
104116
105117 # ## Run tests as user
106118 - name : Run GNU tests
107119 shell : bash
108120 run : |
121+ ## Use unshare
122+ sudo sysctl -w kernel.unprivileged_userns_clone=1
123+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
109124 ## Run GNU tests
110125 path_GNU='gnu'
111126 path_UUTILS='uutils'
@@ -124,30 +139,58 @@ jobs:
124139 path_GNU='gnu'
125140 path_UUTILS='uutils'
126141 bash "uutils/util/run-gnu-test.sh" run-root
142+
127143 - name : Extract testing info from individual logs (run as root) into JSON
128144 shell : bash
129145 run : |
130146 path_UUTILS='uutils'
131147 python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}
132148
149+ # ## This shell has been changed from "bash" to this command
150+ # ## "script" will start a pty and the -q command removes the "script" initiation log
151+ # ## the -e flag makes it propagate the error code and -c runs the command in a pty
152+ # ## the primary purpose of this change is to run the tty GNU tests
153+ # ## The reason its separated from the rest of the tests is because one test can corrupt the other
154+ # ## tests through the use of the shared terminal and it changes the environment that the other
155+ # ## tests are run in, which can cause different results.
156+ - name : Run GNU stty tests
157+ shell : ' script -q -e -c "bash {0}"'
158+ run : |
159+ ## Run GNU root tests
160+ path_GNU='gnu'
161+ path_UUTILS='uutils'
162+ bash "uutils/util/run-gnu-test.sh" run-tty
163+
164+ - name : Extract testing info from individual logs (stty) into JSON
165+ shell : bash
166+ run : |
167+ path_UUTILS='uutils'
168+ python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_STTY_FULL_SUMMARY_FILE }}
169+
133170 # ## Upload artifacts
134171 - name : Upload full json results
135- uses : actions/upload-artifact@v5
172+ uses : actions/upload-artifact@v6
136173 with :
137174 name : gnu-full-result
138175 path : ${{ env.TEST_FULL_SUMMARY_FILE }}
139176 - name : Upload root json results
140- uses : actions/upload-artifact@v5
177+ uses : actions/upload-artifact@v6
141178 with :
142179 name : gnu-root-full-result
143180 path : ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}
181+ - name : Upload stty json results
182+ uses : actions/upload-artifact@v6
183+ with :
184+ name : gnu-stty-full-result
185+ path : ${{ env.TEST_STTY_FULL_SUMMARY_FILE }}
186+
144187 - name : Compress test logs
145188 shell : bash
146189 run : |
147190 # Compress logs before upload (fails otherwise)
148191 gzip gnu/tests/*/*.log
149192 - name : Upload test logs
150- uses : actions/upload-artifact@v5
193+ uses : actions/upload-artifact@v6
151194 with :
152195 name : test-logs
153196 path : |
@@ -160,7 +203,7 @@ jobs:
160203 steps :
161204 # ### Get the code, setup cache
162205 - name : Checkout code (uutils)
163- uses : actions/checkout@v5
206+ uses : actions/checkout@v6
164207 with :
165208 path : ' uutils'
166209 persist-credentials : false
@@ -172,32 +215,19 @@ jobs:
172215 with :
173216 workspaces : " ./uutils -> target"
174217 - name : Checkout code (GNU coreutils)
175- uses : actions/checkout@v5
176- with :
177- repository : ' coreutils/coreutils'
178- path : ' gnu'
179- ref : ${{ env.REPO_GNU_REF }}
180- submodules : false
181- persist-credentials : false
182- - name : Override submodule URL and initialize submodules
183- # Use github instead of upstream git server
184- run : |
185- git submodule sync --recursive
186- git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
187- git submodule update --init --recursive --depth 1
188- working-directory : gnu
218+ run : (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
189219
190220 # ### Lima build environment setup
191221 - name : Setup Lima
192222 uses : lima-vm/lima-actions/setup@v1
193223 id : lima-actions-setup
194224 - name : Cache ~/.cache/lima
195- uses : actions/cache@v4
225+ uses : actions/cache@v5
196226 with :
197227 path : ~/.cache/lima
198228 key : lima-${{ steps.lima-actions-setup.outputs.version }}
199229 - name : Start Fedora VM with SELinux
200- run : limactl start --plain --name=default --cpus=4 --disk=40 --memory=8 --network=lima:user-v2 template:// fedora
230+ run : limactl start --plain --name=default --cpus=4 --disk=40 --memory=8 --network=lima:user-v2 template:fedora
201231 - name : Verify SELinux Status and Configuration
202232 run : |
203233 lima getenforce
@@ -216,7 +246,7 @@ jobs:
216246 - name : Install dependencies in VM
217247 run : |
218248 lima sudo dnf -y update
219- lima sudo dnf -y install git autoconf autopoint bison texinfo gperf gcc g++ gdb jq libacl-devel libattr-devel libcap-devel libselinux-devel attr rustup clang-devel texinfo-tex wget automake patch quilt
249+ lima sudo dnf -y install git autoconf autopoint bison texinfo gperf gcc gdb jq libacl-devel libattr-devel libcap-devel libselinux-devel attr rustup clang-devel texinfo-tex automake patch quilt
220250 lima rustup-init -y --default-toolchain stable
221251 - name : Copy the sources to VM
222252 run : |
@@ -225,7 +255,7 @@ jobs:
225255 # ## Build
226256 - name : Build binaries
227257 run : |
228- lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build "
258+ lima bash -c "cd ~/work/uutils/ && SELINUX_ENABLED=1 PROFILE=release-small bash util/build-gnu.sh"
229259
230260 # ## Run tests as user
231261 - name : Generate SELinux tests list
@@ -266,12 +296,12 @@ jobs:
266296 # Copy the test directory now
267297 rsync -v -a -e ssh lima-default:~/work/gnu/tests/ ./gnu/tests-selinux/
268298 - name : Upload SELinux json results
269- uses : actions/upload-artifact@v5
299+ uses : actions/upload-artifact@v6
270300 with :
271301 name : selinux-gnu-full-result
272302 path : ${{ env.TEST_SELINUX_FULL_SUMMARY_FILE }}
273303 - name : Upload SELinux root json results
274- uses : actions/upload-artifact@v5
304+ uses : actions/upload-artifact@v6
275305 with :
276306 name : selinux-root-gnu-full-result
277307 path : ${{ env.TEST_SELINUX_ROOT_FULL_SUMMARY_FILE }}
@@ -281,7 +311,7 @@ jobs:
281311 # Compress logs before upload (fails otherwise)
282312 gzip gnu/tests-selinux/*/*.log
283313 - name : Upload SELinux test logs
284- uses : actions/upload-artifact@v5
314+ uses : actions/upload-artifact@v6
285315 with :
286316 name : selinux-test-logs
287317 path : |
@@ -309,12 +339,12 @@ jobs:
309339
310340 outputs TEST_SUMMARY_FILE AGGREGATED_SUMMARY_FILE
311341 - name : Checkout code (uutils)
312- uses : actions/checkout@v5
342+ uses : actions/checkout@v6
313343 with :
314344 path : ' uutils'
315345 persist-credentials : false
316346 - name : Retrieve reference artifacts
317- uses : dawidd6/action-download-artifact@v11
347+ uses : dawidd6/action-download-artifact@v12
318348 # ref: <https://github.com/dawidd6/action-download-artifact>
319349 continue-on-error : true # # don't break the build for missing reference artifacts (may be expired or just not generated yet)
320350 with :
@@ -324,25 +354,32 @@ jobs:
324354 workflow_conclusion : completed # # continually recalibrates to last commit of default branch with a successful GnuTests (ie, "self-heals" from GnuTest regressions, but needs more supervision for/of regressions)
325355 path : " reference"
326356 - name : Download full json results
327- uses : actions/download-artifact@v6
357+ uses : actions/download-artifact@v7
328358 with :
329359 name : gnu-full-result
330360 path : results
331361 merge-multiple : true
332362 - name : Download root json results
333- uses : actions/download-artifact@v6
363+ uses : actions/download-artifact@v7
334364 with :
335365 name : gnu-root-full-result
336366 path : results
337367 merge-multiple : true
368+ - name : Download stty json results
369+ uses : actions/download-artifact@v7
370+ with :
371+ name : gnu-stty-full-result
372+ path : results
373+ merge-multiple : true
374+
338375 - name : Download selinux json results
339- uses : actions/download-artifact@v6
376+ uses : actions/download-artifact@v7
340377 with :
341378 name : selinux-gnu-full-result
342379 path : results
343380 merge-multiple : true
344381 - name : Download selinux root json results
345- uses : actions/download-artifact@v6
382+ uses : actions/download-artifact@v7
346383 with :
347384 name : selinux-root-gnu-full-result
348385 path : results
@@ -357,7 +394,7 @@ jobs:
357394 path_UUTILS='uutils'
358395
359396 json_count=$(ls -l results/*.json | wc -l)
360- if [[ "$json_count" -ne 4 ]]; then
397+ if [[ "$json_count" -ne 5 ]]; then
361398 echo "::error ::Failed to download all results json files (expected 4 files, found $json_count); failing early"
362399 ls -lR results || true
363400 exit 1
@@ -391,17 +428,17 @@ jobs:
391428 HASH=$(sha1sum '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' | cut --delim=" " -f 1)
392429 outputs HASH
393430 - name : Upload SHA1/ID of 'test-summary'
394- uses : actions/upload-artifact@v5
431+ uses : actions/upload-artifact@v6
395432 with :
396433 name : " ${{ steps.summary.outputs.HASH }}"
397434 path : " ${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
398435 - name : Upload test results summary
399- uses : actions/upload-artifact@v5
436+ uses : actions/upload-artifact@v6
400437 with :
401438 name : test-summary
402439 path : " ${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
403440 - name : Upload aggregated json results
404- uses : actions/upload-artifact@v5
441+ uses : actions/upload-artifact@v6
405442 with :
406443 name : aggregated-result
407444 path : ${{ steps.vars.outputs.AGGREGATED_SUMMARY_FILE }}
@@ -453,7 +490,7 @@ jobs:
453490 fi
454491 - name : Upload comparison log (for GnuComment workflow)
455492 if : success() || failure() # run regardless of prior step success/failure
456- uses : actions/upload-artifact@v5
493+ uses : actions/upload-artifact@v6
457494 with :
458495 name : comment
459496 path : reference/comment/
0 commit comments