From: Kamalesh Babulal Date: Wed, 22 Feb 2023 14:43:45 +0000 (+0530) Subject: github/actions: Introduce a timeout to avoid apt races X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=930dc6adfc828e55a1e2c96f2f5612b4e38116b1;p=thirdparty%2Flibcgroup.git github/actions: Introduce a timeout to avoid apt races There are chances that apt-get operations are run on the same VM by different runners both competing to get apt locks. Introduce timeout of 3 seconds, in case the lock is already taken by another instance of a runner. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka (cherry picked from commit ddcd79dede4265d891247004432f9c4e845a5a4a) --- diff --git a/.github/actions/setup-libcgroup/action.yml b/.github/actions/setup-libcgroup/action.yml index 29d3f85e..83d63dbd 100644 --- a/.github/actions/setup-libcgroup/action.yml +++ b/.github/actions/setup-libcgroup/action.yml @@ -11,9 +11,13 @@ description: "Install dependencies, git clone, bootstrap, configure, and make li runs: using: "composite" steps: - - run: sudo apt-get update + - run: | + while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do sleep 3; done + sudo apt-get update shell: bash - - run: sudo apt-get install libpam-dev lcov python3-pip python3-dev cmake bison flex byacc g++ autoconf automake libtool libsystemd-dev -y + - run: | + while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do sleep 3; done + sudo apt-get install libpam-dev lcov python3-pip python3-dev cmake bison flex byacc g++ autoconf automake libtool libsystemd-dev -y shell: bash - run: sudo pip install cython shell: bash