diff --git a/github-actions-tune/.github/workflows/default.yml b/github-actions-tune/.github/workflows/default.yml new file mode 100644 index 0000000..8bbb4e4 --- /dev/null +++ b/github-actions-tune/.github/workflows/default.yml @@ -0,0 +1,15 @@ +name: Default + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Update apt sources + run: sudo apt-get update -y + - name: Install libguestfs-tools + run: sudo apt-get install libguestfs-tools -y diff --git a/github-actions-tune/.github/workflows/tuned.yml b/github-actions-tune/.github/workflows/tuned.yml new file mode 100644 index 0000000..4db1269 --- /dev/null +++ b/github-actions-tune/.github/workflows/tuned.yml @@ -0,0 +1,17 @@ +name: Tuned + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Apply settings + run: ./speedup.sh + - name: Update apt sources + run: sudo apt-get update -y + - name: Install libguestfs-tools + run: sudo apt-get install libguestfs-tools -y diff --git a/github-actions-tune/README.md b/github-actions-tune/README.md new file mode 100644 index 0000000..8196a6f --- /dev/null +++ b/github-actions-tune/README.md @@ -0,0 +1,10 @@ +# Forked from https://github.com/abbbi/github-actions-tune + +Speed up your github actions on `ubuntu-latest`. For the full article, see: + +[A few simple tricks to tune your github actions runtime](https://abbbi.github.io/actions/) + +You can speed up your runtime by using this action repository +in your yml files, see: + + [This example repository](https://github.com/abbbi/tuneme/blob/master/.github/workflows/tuned.yml) diff --git a/github-actions-tune/action.yml b/github-actions-tune/action.yml new file mode 100644 index 0000000..883cee0 --- /dev/null +++ b/github-actions-tune/action.yml @@ -0,0 +1,7 @@ +name: 'Speedup package installation' +description: 'Tune your runtime on ubuntu-latest' +runs: + using: "composite" + steps: + - run: ${{ github.action_path }}/speedup.sh + shell: bash diff --git a/github-actions-tune/speedup.sh b/github-actions-tune/speedup.sh new file mode 100644 index 0000000..0e2f70c --- /dev/null +++ b/github-actions-tune/speedup.sh @@ -0,0 +1,14 @@ +#!/bin/bash +sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf +sudo rm -f /var/lib/man-db/auto-update +sudo sed '/fontconfig/d' -i /var/lib/dpkg/triggers/File +sudo sed '/install-info/d' -i /var/lib/dpkg/triggers/File +sudo sed '/mime/d' -i /var/lib/dpkg/triggers/File +sudo sed '/hicolor-icon-theme/d' -i /var/lib/dpkg/triggers/File +echo "force-unsafe-io" | sudo tee -a /etc/dpkg/dpkg.cfg.d/force-unsafe-io +if [ -a /usr/bin/eatmydata ]; then + echo "eatmydata available" + echo -e '#!/bin/sh\nexec eatmydata /usr/bin/dpkg $@' | sudo tee /usr/local/bin/dpkg && sudo chmod +x /usr/local/bin/dpkg + echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt $@' | sudo tee /usr/local/bin/apt && sudo chmod +x /usr/local/bin/apt + 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 +fi