├── .github └── workflows │ ├── default.yml │ └── tuned.yml ├── README.md ├── action.yml └── speedup.sh /.github/workflows/default.yml: -------------------------------------------------------------------------------- 1 | name: Default 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Update apt sources 13 | run: sudo apt-get update -y 14 | - name: Install libguestfs-tools 15 | run: sudo apt-get install libguestfs-tools -y 16 | -------------------------------------------------------------------------------- /.github/workflows/tuned.yml: -------------------------------------------------------------------------------- 1 | name: Tuned 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Apply settings 13 | run: ./speedup.sh 14 | - name: Update apt sources 15 | run: sudo apt-get update -y 16 | - name: Install libguestfs-tools 17 | run: sudo apt-get install libguestfs-tools -y 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Speed up your github actions on `ubuntu-latest`. For the full article, see: 2 | 3 | [A few simple tricks to tune your github actions runtime](https://abbbi.github.io/actions/) 4 | 5 | You can speed up your runtime by using this action repository 6 | in your yml files, see: 7 | 8 | [This example repository](https://github.com/abbbi/tuneme/blob/master/.github/workflows/tuned.yml) 9 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Speedup package installation' 2 | description: 'Tune your runtime on ubuntu-latest' 3 | runs: 4 | using: "composite" 5 | steps: 6 | - run: ${{ github.action_path }}/speedup.sh 7 | shell: bash 8 | -------------------------------------------------------------------------------- /speedup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | INITRAMFS_CONF="/etc/initramfs-tools/update-initramfs.conf" 3 | DPKG_TRIGGERS="/var/lib/dpkg/triggers/File" 4 | 5 | if [ -e $INITRAMFS_CONF ]; then 6 | sudo sed -i 's/yes/no/g' $INITRAMFS_CONF 7 | fi 8 | sudo rm -f /var/lib/man-db/auto-update 9 | 10 | if [ -e $DPKG_TRIGGERS ]; then 11 | sudo sed '/fontconfig/d' -i $DPKG_TRIGGERS 12 | sudo sed '/install-info/d' -i $DPKG_TRIGGERS 13 | sudo sed '/mime/d' -i $DPKG_TRIGGERS 14 | sudo sed '/hicolor-icon-theme/d' -i $DPKG_TRIGGERS 15 | fi 16 | 17 | echo "force-unsafe-io" | sudo tee -a /etc/dpkg/dpkg.cfg.d/force-unsafe-io 18 | 19 | if [ -a /usr/bin/eatmydata ]; then 20 | echo "eatmydata available" 21 | echo -e '#!/bin/sh\nexec eatmydata /usr/bin/dpkg $@' | sudo tee /usr/local/bin/dpkg && sudo chmod +x /usr/local/bin/dpkg 22 | echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt $@' | sudo tee /usr/local/bin/apt && sudo chmod +x /usr/local/bin/apt 23 | 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 24 | fi 25 | --------------------------------------------------------------------------------