Skip to content

Commit eeedab2

Browse files
committed
Add GitHub CI
1 parent 7b64859 commit eeedab2

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,24 @@ 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
31-
if: steps.cache.outputs.cache-hit != 'true'
25+
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
35-
echo "Initramfs built successfully at freemyipod/initramfs.cpio.gz"
3631
3732
- name: Upload initramfs artifact
3833
uses: actions/upload-artifact@v7
@@ -62,20 +57,39 @@ jobs:
6257
libncurses-dev \
6358
device-tree-compiler \
6459
python3 \
65-
python3-pip
60+
python3-pip \
61+
ccache
6662
6763
- name: Install Python dependencies for dtbs_check
6864
run: |
6965
pip3 install --upgrade pip
7066
pip3 install dtschema yamllint
7167
68+
- name: Restore global ccache
69+
uses: actions/cache@v5
70+
with:
71+
path: ~/.ccache
72+
key: ccache-global
73+
restore-keys: ccache-global
74+
75+
- name: Setup ccache
76+
run: |
77+
export PATH="/usr/lib/ccache:$PATH"
78+
ccache --zero-stats
79+
ccache --max-size=256M
80+
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
81+
7282
- name: Configure kernel
7383
run: |
7484
make ARCH=arm apple_n31_defconfig
7585
7686
- name: Build kernel
7787
run: |
88+
export PATH="/usr/lib/ccache:$PATH"
89+
export CC="ccache arm-none-eabi-gcc"
90+
export HOSTCC="ccache gcc"
7891
make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j $(nproc) dtbs_check dtbs zImage
92+
ccache --show-stats
7993
8094
- name: Copy kernel and DTB to /freemyipod
8195
run: |
@@ -100,13 +114,13 @@ jobs:
100114
uses: actions/checkout@v6
101115

102116
- name: Download initramfs artifact
103-
uses: actions/download-artifact@v3
117+
uses: actions/download-artifact@v8
104118
with:
105119
name: initramfs
106120
path: freemyipod
107121

108122
- name: Download kernel artifacts
109-
uses: actions/download-artifact@v3
123+
uses: actions/download-artifact@v8
110124
with:
111125
name: kernel
112126
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)