Skip to content

Commit dfd2f07

Browse files
committed
Github Actions: speed up s390x workflow
origin s390x workflow is very slow, sometimes even consume time over 1 hours. to speed up this workflow, I changed to following: 1. cross-compile s390x on build-machine, this will save about 15 minitus. 2. use prebuild dependencies. 3. only do `misc/units tmain` and `misc/units run` Signed-off-by: leleliu008 <[email protected]>
1 parent a8839b4 commit dfd2f07

File tree

1 file changed

+95
-27
lines changed

1 file changed

+95
-27
lines changed

.github/workflows/testing-big-endian.yml

Lines changed: 95 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,100 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
s390x_job:
11-
runs-on: ubuntu-22.04
12-
name: Build on ubuntu-22.04 s390x
10+
s390x:
11+
runs-on: ubuntu-latest
12+
1313
steps:
14-
- uses: actions/checkout@v2.1.0
15-
- uses: uraimo/run-on-arch-action@v2
16-
name: Run commands
17-
id: runcmd
14+
- uses: actions/checkout@v3
15+
16+
- uses: actions/cache@v3
17+
id: restore-cache
1818
with:
19-
arch: s390x
20-
distro: fedora_latest
21-
#
22-
# We don't install libseccomp-devel because sandbox related test cases fail.
23-
#
24-
# Adjust safe.directory because we got following messages when running make check-genfile:
25-
#
26-
# fatal: unsafe repository ('/home/runner/work/ctags/ctags' is owned by someone else)
27-
# To add an exception for this directory, call:
28-
# git config --global --add safe.directory /home/runner/work/ctags/ctags
29-
#
30-
install: |
31-
dnf -y install git gdb procps-ng gcc automake autoconf pkgconfig make libxml2-devel jansson-devel libyaml-devel pcre2-devel findutils diffutils sudo
32-
run: |
33-
bash ./autogen.sh
34-
./configure --enable-debugging
35-
make -j 2
36-
readelf -h ctags
37-
git config --global --add safe.directory $(pwd)
38-
make check
19+
path: /home/runner/linux-s390x-glibc
20+
key: dependent-packages-linux-s390x-glibc
21+
restore-keys: dependent-packages-linux-s390x-glibc
22+
23+
- if: ${{ steps.restore-cache.outputs.cache-hit != 'true' }}
24+
run: |
25+
set -x
26+
27+
mkdir -p /home/runner/linux-s390x-glibc
28+
29+
curl -L -o lastest.json https://api.github.com/repos/leleliu008/uppm-package-repository-linux-s390x-glibc/releases/latest
30+
31+
unset RELEASE_TAG_NAME_
32+
unset RELEASE_FILENAMES
33+
34+
RELEASE_TAG_NAME_=$(jq -r '.tag_name' lastest.json)
35+
RELEASE_FILENAMES=$(jq -r '.assets[].name' lastest.json)
36+
37+
for filename in $RELEASE_FILENAMES
38+
do
39+
case $filename in
40+
jansson-*-linux-s390x-glibc.tar.xz) ;;
41+
libiconv-*-linux-s390x-glibc.tar.xz) ;;
42+
libxml2-*-linux-s390x-glibc.tar.xz) ;;
43+
libyaml-*-linux-s390x-glibc.tar.xz) ;;
44+
pcre2-*-linux-s390x-glibc.tar.xz) ;;
45+
zlib-*-linux-s390x-glibc.tar.xz) ;;
46+
*) continue ;;
47+
esac
48+
curl -LO https://github.com/leleliu008/uppm-package-repository-linux-s390x-glibc/releases/download/${RELEASE_TAG_NAME_}/${filename}
49+
tar xf ${filename} -C /home/runner/linux-s390x-glibc --strip-components=1
50+
done
51+
52+
rm -rf /home/runner/linux-s390x-glibc/share/log
53+
rm -rf /home/runner/linux-s390x-glibc/share/man
54+
rm -rf /home/runner/linux-s390x-glibc/share/doc
55+
rm -rf /home/runner/linux-s390x-glibc/share/gtk-doc
56+
rm -rf /home/runner/linux-s390x-glibc/lib/libz.so*
57+
rm -rf /home/runner/linux-s390x-glibc/lib/lib*.la
58+
rm -rf /home/runner/linux-s390x-glibc/installed-files
59+
rm -rf /home/runner/linux-s390x-glibc/installed-metadata-ppkg
60+
61+
- run: sudo apt-get -y update
62+
- run: sudo apt-get -y install automake autoconf pkg-config make gcc-s390x-linux-gnu
63+
64+
- run: ./autogen.sh
65+
- run: |
66+
export CC=/usr/bin/s390x-linux-gnu-gcc
67+
export CPPFLAGS=-I/home/runner/linux-s390x-glibc/include
68+
export LDFLAGS=-L/home/runner/linux-s390x-glibc/lib
69+
export PKG_CONFIG_PATH=/home/runner/linux-s390x-glibc/lib/pkgconfig
70+
./configure --host=s390x-ibm-linux-gnu --enable-debugging || (cat config.log; exit 1)
71+
- run: make -j$(nproc)
72+
73+
- run: /usr/bin/s390x-linux-gnu-readelf -h ctags
74+
- run: /usr/bin/s390x-linux-gnu-readelf -d ctags
75+
76+
- run: |
77+
cat > run.sh <<EOF
78+
set -e
79+
80+
COLOR_GREEN='\033[0;32m' # Green
81+
COLOR_PURPLE='\033[0;35m' # Purple
82+
COLOR_OFF='\033[0m' # Reset
83+
84+
echo() {
85+
printf '%b\n' "\$*"
86+
}
87+
88+
run() {
89+
echo "\${COLOR_PURPLE}==>\${COLOR_OFF} \${COLOR_GREEN}\$@\${COLOR_OFF}"
90+
eval "\$*"
91+
}
92+
93+
run uname -a
94+
95+
run apt-get -y update
96+
run apt-get -y install make python3
97+
98+
run make tmain CI=1 CTAGS_DEP= READTAGS_DEP= OPTSCRIPT_DEP=
99+
run make units CI=1 CTAGS_DEP=
100+
EOF
101+
102+
chmod +x run.sh
103+
104+
# https://github.com/multiarch/qemu-user-static
105+
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
106+
- run: docker run -v $PWD:$PWD -w $PWD s390x/ubuntu bash run.sh

0 commit comments

Comments
 (0)