Skip to content

Build cache

Build cache #72

Workflow file for this run

name: Build cache
on: workflow_dispatch
jobs:
build-cache:
name: Build target cache
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
target: [qualcommax, mediatek, x86]
version: [main]
exclude:
- os: ubuntu-24.04
target: qualcommax
version: main
- os: ubuntu-24.04
target: mediatek
version: main
- os: ubuntu-24.04-arm
target: x86
version: main
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ matrix.target }}_${{ matrix.version }}
permissions:
actions: write
contents: write
steps:
- name: Install packages
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
with:
packages: build-essential \
clang \
flex \
bison \
g++ \
gawk \
gcc-multilib \
g++-multilib \
gettext \
git \
libncurses5-dev \
libssl-dev \
python3-netifaces \
python3-pkg-resources \
python3-setuptools \
python3-socks \
python3-unidecode \
rsync \
swig \
unzip \
zlib1g-dev \
file \
wget
- name: Restore cache
id: cache-restore
uses: actions/cache/restore@v5
with:
path: ${{ matrix.target }}_${{ matrix.version }}
key: ${{ matrix.os }}-${{ matrix.target }}_${{ matrix.version }}
- name: Checkout
uses: actions/checkout@v6
with:
path: ${{ matrix.target }}_${{ matrix.version }}
clean: false
- name: Get SHA
uses: benjlevesque/short-sha@main
- name: Update feeds
run: make package/symlinks
- name: Import config
run: mv .config_${{ matrix.target }}_${{ matrix.version }} .config
- name: Update config
run: make defconfig
- name: Prepare build
run: make -j$(($(nproc)+1)) download prepare
- name: Delete old cache
if: ${{ steps.cache-restore.outputs.cache-hit }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh cache delete "${{ matrix.os }}-${{ matrix.target }}_${{ matrix.version }}"
continue-on-error: true
- name: Save cache
id: cache-save
uses: actions/cache/save@v5
with:
path: ${{ matrix.target }}_${{ matrix.version }}
key: ${{ matrix.os }}-${{ matrix.target }}_${{ matrix.version }}
- name: Save cache (if error)
if: always()
uses: actions/cache/save@v5
with:
path: ${{ matrix.target }}_${{ matrix.version }}
key: ${{ matrix.os }}-${{ matrix.target }}_${{ matrix.version }}