forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 4
98 lines (87 loc) · 2.57 KB
/
build-cache.yml
File metadata and controls
98 lines (87 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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 }}