Skip to content

Commit 30663d1

Browse files
committed
🧪 Speed-up apt operations in CI
1 parent 5077da8 commit 30663d1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,35 @@ jobs:
375375
TOXENV: make-changelog
376376

377377
steps:
378+
- name: Disable dpkg triggers to speed up apt
379+
# yamllint disable rule:line-length
380+
run: |
381+
INITRAMFS_CONF="/etc/initramfs-tools/update-initramfs.conf"
382+
DPKG_TRIGGERS="/var/lib/dpkg/triggers/File"
383+
384+
if [ -e $INITRAMFS_CONF ]; then
385+
sudo sed -i 's/yes/no/g' $INITRAMFS_CONF
386+
fi
387+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
388+
sudo dpkg-reconfigure man-db
389+
390+
if [ -e $DPKG_TRIGGERS ]; then
391+
sudo sed '/fontconfig/d' -i $DPKG_TRIGGERS
392+
sudo sed '/install-info/d' -i $DPKG_TRIGGERS
393+
sudo sed '/mime/d' -i $DPKG_TRIGGERS
394+
sudo sed '/hicolor-icon-theme/d' -i $DPKG_TRIGGERS
395+
fi
396+
397+
echo "force-unsafe-io" | sudo tee -a /etc/dpkg/dpkg.cfg.d/force-unsafe-io
398+
399+
if [ -a /usr/bin/eatmydata ]; then
400+
echo "eatmydata available"
401+
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/dpkg $@' | sudo tee /usr/local/bin/dpkg && sudo chmod +x /usr/local/bin/dpkg
402+
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt $@' | sudo tee /usr/local/bin/apt && sudo chmod +x /usr/local/bin/apt
403+
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt-get $@' | sudo tee /usr/local/bin/apt-get && sudo chmod +x /usr/local/bin/apt-get
404+
fi
405+
# yamllint enable rule:line-length
406+
378407
- name: Switch to using Python 3.11
379408
uses: actions/setup-python@v5
380409
with:

0 commit comments

Comments
 (0)