Skip to content

Commit 77322b5

Browse files
committed
Use container: + image: vs runs-on.
1 parent 3581547 commit 77322b5

4 files changed

Lines changed: 33 additions & 26 deletions

File tree

.github/workflows/rtpproxy_ci.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ jobs:
3030
needs: LoadJobs_conf
3131
if: needs.LoadJobs_conf.outputs.do_MinBuild == 'true'
3232
# The type of runner that the job will run on
33-
runs-on: ubuntu-${{ matrix.os }}
33+
runs-on: ubuntu-latest
34+
container:
35+
image: ubuntu:${{ matrix.os }}
36+
options: >-
37+
-v sources:/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
3438
env:
3539
COMPILER: ${{ matrix.compiler }}
3640
TAR_CMD: tar_nosuid
@@ -66,6 +70,11 @@ jobs:
6670
compiler: 'clang'
6771

6872
steps:
73+
- name: Install git
74+
run: |
75+
apt-get update
76+
apt-get install -y git lsb-release gnupg2 wget
77+
6978
- uses: actions/checkout@v6
7079
with:
7180
submodules: 'recursive'
@@ -74,14 +83,7 @@ jobs:
7483
if: endsWith(matrix.compiler, '-cross')
7584
run: sh -x scripts/build/start_container.sh
7685

77-
- name: Workaround for tar not being able to access /var/cache/apt/archives
78-
if: endsWith(matrix.compiler, '-cross') == 0
79-
run: |
80-
sudo cp "$(command -v tar)" "$(command -v tar)"_nosuid
81-
sudo chmod u+s "$(command -v tar)"
82-
8386
- name: Cache apt-get packages
84-
if: endsWith(matrix.compiler, '-cross') == 0
8587
uses: actions/cache@v5
8688
with:
8789
path: /var/cache/apt/archives
@@ -93,12 +95,6 @@ jobs:
9395
- name: Install apt-get updates
9496
run: scripts/ft-apt-get-update.sh
9597

96-
- name: Set up Python
97-
if: endsWith(matrix.compiler, '-cross') == 0
98-
uses: actions/setup-python@v6
99-
with:
100-
python-version: 3.9
101-
10298
- name: install_depends
10399
run: sh -x scripts/build/install_depends.sh
104100

scripts/build/build.conf.sub

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ then
3232
SUDO="sudo"
3333
fi
3434

35+
PKGS="${PKGS} wget make git pkg-config libtool automake autoconf python3"
36+
3537
case "${COMPILER}" in
3638
gcc)
3739
export CC="${COMPILER}"
@@ -44,7 +46,7 @@ gcc-i386-cross)
4446
DOCKR_PLATFORM="x86_64"
4547
export BUILD_OS="ubuntu-18.04"
4648
PRE_INSTALL_CMD="enable_arch i386"
47-
PKGS="${PKGS} wget make git libssl-dev:i386 pkg-config libtool automake autoconf python3 gcc g++ libc6-dev:i386 libstdc++6:i386 lib32gcc-7-dev"
49+
PKGS="${PKGS} libssl-dev:i386 gcc g++ libc6-dev:i386 libstdc++6:i386 lib32gcc-7-dev"
4850
;;
4951
gcc-mips64-cross)
5052
DOCKR_BASE="ubuntu:18.04"
@@ -54,7 +56,7 @@ gcc-mips64-cross)
5456
export AR="mips64-linux-gnuabi64-ar"
5557
export RANLIB="mips64-linux-gnuabi64-ranlib"
5658
POST_INSTALL_CMD="setup_qemu mips64 gnuabi64"
57-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 gcc-mips64-linux-gnuabi64 libc-dev-mips64-cross qemu-user-static"
59+
PKGS="${PKGS} libssl-dev gcc-mips64-linux-gnuabi64 libc-dev-mips64-cross qemu-user-static"
5860
;;
5961
gcc-arm32-cross)
6062
export CC="arm-linux-gnueabihf-gcc"
@@ -64,7 +66,7 @@ gcc-arm32-cross)
6466
export BUILD_OS="ubuntu-18.04"
6567
DOCKR_BASE="ubuntu:18.04"
6668
DOCKR_PLATFORM="x86_64"
67-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 gcc-arm-linux-gnueabihf libc-dev-armhf-cross qemu-user-static"
69+
PKGS="${PKGS} libssl-dev gcc-arm-linux-gnueabihf libc-dev-armhf-cross qemu-user-static"
6870
;;
6971
gcc-arm64-cross)
7072
export CC="aarch64-linux-gnu-gcc"
@@ -74,35 +76,35 @@ gcc-arm64-cross)
7476
export BUILD_OS="ubuntu-18.04"
7577
DOCKR_BASE="ubuntu:18.04"
7678
DOCKR_PLATFORM="x86_64"
77-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 gcc-aarch64-linux-gnu libc-dev-arm64-cross qemu-user-static"
79+
PKGS="${PKGS} libssl-dev gcc-aarch64-linux-gnu libc-dev-arm64-cross qemu-user-static"
7880
;;
7981
gcc-arm32-qemu-cross)
8082
export CC="/usr/lib/ccache/gcc"
8183
export CCACHE_DIR="`pwd`/ccache"
8284
DOCKR_BASE="ubuntu"
8385
DOCKR_PLATFORM="arm/v7"
84-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 gcc g++ ccache"
86+
PKGS="${PKGS} libssl-dev gcc g++ ccache"
8587
;;
8688
clang-arm32-qemu-cross)
8789
export CC="/usr/lib/ccache/clang"
8890
export CCACHE_DIR="`pwd`/ccache"
8991
DOCKR_BASE="ubuntu"
9092
DOCKR_PLATFORM="arm/v7"
91-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 clang llvm-dev ccache"
93+
PKGS="${PKGS} libssl-dev clang llvm-dev ccache"
9294
;;
9395
gcc-arm64-qemu-cross)
9496
export CC="/usr/lib/ccache/gcc"
9597
export CCACHE_DIR="`pwd`/ccache"
9698
DOCKR_BASE="ubuntu"
9799
DOCKR_PLATFORM="arm64/v8"
98-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 gcc g++ ccache"
100+
PKGS="${PKGS} libssl-dev gcc g++ ccache"
99101
;;
100102
clang-arm64-qemu-cross)
101103
export CC="/usr/lib/ccache/clang"
102104
export CCACHE_DIR="`pwd`/ccache"
103105
DOCKR_BASE="ubuntu"
104106
DOCKR_PLATFORM="arm64/v8"
105-
PKGS="${PKGS} wget make git libssl-dev pkg-config libtool automake autoconf python3 clang llvm-dev ccache"
107+
PKGS="${PKGS} libssl-dev clang llvm-dev ccache"
106108
;;
107109
clang)
108110
export CC="${COMPILER}"
@@ -118,7 +120,7 @@ clang-i386-cross)
118120
DOCKR_PLATFORM="x86_64"
119121
export BUILD_OS="ubuntu-18.04"
120122
PRE_INSTALL_CMD="enable_arch i386"
121-
PKGS="${PKGS} wget make git libssl-dev:i386 pkg-config libtool automake autoconf python3 clang llvm-dev libc6-dev:i386 libstdc++6:i386 lib32gcc-7-dev"
123+
PKGS="${PKGS} libssl-dev:i386 clang llvm-dev libc6-dev:i386 libstdc++6:i386 lib32gcc-7-dev"
122124
;;
123125
gcc-*)
124126
export CC="${COMPILER}"

scripts/build/start_container.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ then
1111
exit 1
1212
fi
1313

14-
sudo apt-get update
15-
sudo apt-get install -y qemu-user-static
14+
if ! docker -v 2>/dev/null
15+
then
16+
${SUDO} apt-get update
17+
${SUDO} apt-get install -y docker.io
18+
fi
19+
docker run --rm --privileged tonistiigi/binfmt:latest -install all
1620
docker pull ${DOCKR_BASE}
17-
docker run --cidfile "${DKR_CID_FILE}" -d --restart=always --platform linux/${DOCKR_PLATFORM} -v `pwd`:`pwd` ${DOCKR_BASE} sleep infinity
21+
docker run --cidfile "${DKR_CID_FILE}" -d --restart=always \
22+
--platform linux/${DOCKR_PLATFORM} -v sources:`pwd` ${DOCKR_BASE} sleep infinity

scripts/do-build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ fi
4040

4141
if [ "${TTYPE}" = "cleanbuild" ]
4242
then
43+
if [ -n "${DOCKR_PLATFORM}" ]
44+
then
45+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --host=${DOCKR_PLATFORM}-pc-linux-gnu"
46+
fi
4347
./configure ${CONFIGURE_ARGS}
4448
exec make ${ALLCLEAN_TGT}
4549
fi

0 commit comments

Comments
 (0)