Skip to content

Commit a6af2a2

Browse files
committed
🧪 Speed up apt interactions in changelog job
1 parent e5cdd10 commit a6af2a2

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
@@ -440,6 +440,35 @@ jobs:
440440
TOXENV: make-changelog
441441

442442
steps:
443+
- name: Disable dpkg triggers to speed up apt
444+
# yamllint disable rule:line-length
445+
run: |
446+
INITRAMFS_CONF="/etc/initramfs-tools/update-initramfs.conf"
447+
DPKG_TRIGGERS="/var/lib/dpkg/triggers/File"
448+
449+
if [ -e $INITRAMFS_CONF ]; then
450+
sudo sed -i 's/yes/no/g' $INITRAMFS_CONF
451+
fi
452+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
453+
sudo dpkg-reconfigure man-db
454+
455+
if [ -e $DPKG_TRIGGERS ]; then
456+
sudo sed '/fontconfig/d' -i $DPKG_TRIGGERS
457+
sudo sed '/install-info/d' -i $DPKG_TRIGGERS
458+
sudo sed '/mime/d' -i $DPKG_TRIGGERS
459+
sudo sed '/hicolor-icon-theme/d' -i $DPKG_TRIGGERS
460+
fi
461+
462+
echo "force-unsafe-io" | sudo tee -a /etc/dpkg/dpkg.cfg.d/force-unsafe-io
463+
464+
if [ -a /usr/bin/eatmydata ]; then
465+
echo "eatmydata available"
466+
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/dpkg $@' | sudo tee /usr/local/bin/dpkg && sudo chmod +x /usr/local/bin/dpkg
467+
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt $@' | sudo tee /usr/local/bin/apt && sudo chmod +x /usr/local/bin/apt
468+
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
469+
fi
470+
# yamllint enable rule:line-length
471+
443472
- name: Switch to using Python 3.11
444473
uses: actions/[email protected]
445474
with:

0 commit comments

Comments
 (0)