From 2ee65ff9eea2fe2a75a9575ee23425ce1e4e7326 Mon Sep 17 00:00:00 2001 From: Jack Tench <79285604+JackTench@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:27:59 +0000 Subject: [PATCH] Cache dependencies in actions (#228) * Cache dependencies in actions * Add PPA before caching action does not support adding the PPA --- .github/workflows/build.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 073cca7..a581891 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,14 +10,29 @@ jobs: with: fetch-depth: 0 - - name: "Install dependencies" + - name: "Add gcc-15 PPA" run: | - sudo add-apt-repository ppa:puni070/gcc-noble -y - sudo apt -y update - sudo apt -y install gcc-15 libgtk-3-dev libx11-dev libjansson-dev libluajit-5.1-dev - sudo pip3 install meson - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 150 - sudo update-alternatives --set gcc /usr/bin/gcc-15 + sudo add-apt-repository ppa:puni070/gcc-noble -y + sudo apt update + + - name: "Install and cache C dependencies" + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: > + gcc-15 + libgtk-3-dev + libx11-dev + libjansson-dev + libluajit-5.1-dev + version: 1.0 + + - name: "Install Meson" + run: sudo pip3 install meson + + - name: "Set up compiler" + run: | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 150 + sudo update-alternatives --set gcc /usr/bin/gcc-15 - name: "Configure" run: meson setup build -Dbuildtype=release -Dprefix=/usr