Skip to content

Commit 1714da2

Browse files
committed
Add GitHub CI
1 parent 7b64859 commit 1714da2

File tree

3 files changed

+31
-20
lines changed

3 files changed

+31
-20
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,22 @@ jobs:
1010
outputs:
1111
artifact-path: freemyipod/initramfs.cpio.gz
1212
steps:
13-
- name: Checkout source
14-
uses: actions/checkout@v6
15-
16-
- name: Install system dependencies
17-
run: |
18-
sudo apt-get update
19-
sudo apt-get install -y \
20-
qemu-user-static \
21-
systemd-container
22-
23-
- name: Cache initramfs
13+
- name: Restore initramfs from cache
2414
id: cache
2515
uses: actions/cache@v5
2616
with:
2717
path: freemyipod/initramfs.cpio.gz
2818
key: initramfs-${{ hashFiles('freemyipod/build-initramfs.sh') }}
2919

20+
- name: Checkout source if cache miss
21+
if: steps.cache.outputs.cache-hit != 'true'
22+
uses: actions/checkout@v6
23+
3024
- name: Build initramfs if cache miss
3125
if: steps.cache.outputs.cache-hit != 'true'
3226
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y qemu-user-static systemd-container
3329
chmod +x freemyipod/build-initramfs.sh
3430
freemyipod/build-initramfs.sh
3531
echo "Initramfs built successfully at freemyipod/initramfs.cpio.gz"
@@ -62,20 +58,39 @@ jobs:
6258
libncurses-dev \
6359
device-tree-compiler \
6460
python3 \
65-
python3-pip
61+
python3-pip \
62+
ccache
6663
6764
- name: Install Python dependencies for dtbs_check
6865
run: |
6966
pip3 install --upgrade pip
7067
pip3 install dtschema yamllint
7168
69+
- name: Restore global ccache
70+
uses: actions/cache@v5
71+
with:
72+
path: ~/.ccache
73+
key: ccache-global
74+
restore-keys: ccache-global
75+
76+
- name: Setup ccache
77+
run: |
78+
export PATH="/usr/lib/ccache:$PATH"
79+
ccache --zero-stats
80+
ccache --max-size=256M
81+
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
82+
7283
- name: Configure kernel
7384
run: |
7485
make ARCH=arm apple_n31_defconfig
7586
7687
- name: Build kernel
7788
run: |
89+
export PATH="/usr/lib/ccache:$PATH"
90+
export CC="ccache arm-none-eabi-gcc"
91+
export HOSTCC="ccache gcc"
7892
make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j $(nproc) dtbs_check dtbs zImage
93+
ccache --show-stats
7994
8095
- name: Copy kernel and DTB to /freemyipod
8196
run: |
@@ -100,13 +115,13 @@ jobs:
100115
uses: actions/checkout@v6
101116

102117
- name: Download initramfs artifact
103-
uses: actions/download-artifact@v3
118+
uses: actions/download-artifact@v8
104119
with:
105120
name: initramfs
106121
path: freemyipod
107122

108123
- name: Download kernel artifacts
109-
uses: actions/download-artifact@v3
124+
uses: actions/download-artifact@v8
110125
with:
111126
name: kernel
112127
path: freemyipod

freemyipod/build-initramfs.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ URL=https://dl-cdn.alpinelinux.org/alpine/${MAJOR}/releases/${ARCH}/${TAR}
1010

1111
wget -c $URL
1212
WORK_DIR=$(mktemp -d)
13-
trap 'rm -rf "$WORK_DIR"' EXIT
13+
trap 'sudo rm -rf "$WORK_DIR"' EXIT
1414
tar xf ${TAR} -C $WORK_DIR
1515

1616
# create minimal /init for initramfs
@@ -65,9 +65,6 @@ do dropbearkey -t \$algo -f /etc/dropbear/dropbear_\${algo}_host_key; done
6565
6666
# set root password
6767
echo -ne 'alpine\nalpine\n' | passwd root
68-
69-
# mount sysfs
70-
mount -t sysfs sysfs /sys
7168
"
7269

7370
rm -rf "$WORK_DIR/qemu-arm-static"
@@ -77,4 +74,4 @@ rm -rf "$WORK_DIR/qemu-arm-static"
7774
find $WORK_DIR -printf "%P\0" |
7875
sudo cpio --directory=$WORK_DIR --null --create --verbose --owner root:root --format=newc |
7976
gzip -9
80-
) > initramfs.cpio.gz
77+
) > freemyipod/initramfs.cpio.gz

freemyipod/kernel_fdt.its

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
type = "ramdisk";
4040
arch = "arm";
4141
os = "linux";
42-
compression = "gzip";
4342
hash {
4443
algo = "crc32";
4544
};

0 commit comments

Comments
 (0)