]> git.ipfire.org Git - thirdparty/dracut.git/blob - fedora-test-github.sh
dracut_mkdir(): create parent directories as needed.
[thirdparty/dracut.git] / fedora-test-github.sh
1 #!/bin/bash
2
3 set -ex
4
5 [[ -d ${0%/*} ]] && cd ${0%/*}
6
7 RUN_ID="$1"
8 TESTS=$2
9
10 # GitHub workflows fetch a clone of the dracut repository which doesn't
11 # contain git tags, thus "breaking" the RPM build in certain situations
12 # i.e.:
13 # DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
14 # which in full git clone returns a tag with a numeric version. However,
15 # without tags it returns SHA of the last commit, which later propagates into
16 # `Provides:` attribute of the built RPM and can break dependency tree when
17 # installed
18 [[ -d .git ]] && git fetch --tags && git describe --tags
19
20 ./configure
21
22 NCPU=$(getconf _NPROCESSORS_ONLN)
23
24 if ! [[ $TESTS ]]; then
25 make -j$NCPU all syncheck rpm logtee
26 else
27 [[ $TESTS == "99" ]] && make_docs=yes || make_docs=no
28 make -j$NCPU enable_documentation=$make_docs all logtee
29
30 cd test
31
32 time LOGTEE_TIMEOUT_MS=590000 make \
33 enable_documentation=$make_docs \
34 KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
35 DRACUT_NO_XATTR=1 \
36 TEST_RUN_ID=$RUN_ID \
37 ${TESTS:+TESTS="$TESTS"} \
38 -k V=1 \
39 check
40 fi