-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (129 loc) · 4.47 KB
/
Copy pathbasic.yml
File metadata and controls
135 lines (129 loc) · 4.47 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: basics&stress_smoking
on:
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build-kernel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Clone latest tree
run: |
sudo rm -rf erofs; mkdir -p erofs
git clone git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git -b dev-test erofs
- name: Set up kernel tree
run: |
sudo apt -qq update
sudo apt-get install -y libssl-dev libelf-dev flex bison dwarves
cd erofs
scripts/kconfig/merge_config.sh -m arch/x86/configs/x86_64_defconfig ../erofs-kernelconfig && \
make olddefconfig
- name: Get the HEAD commit ID
id: get_version_id
run: |
echo "scm_version=`cd erofs; git rev-parse --verify HEAD | cut -c1-8`" >> $GITHUB_OUTPUT
rm -rf erofs/.git # delete .git to save space
- name: Cache bzImage
id: cache-bzImage
uses: actions/cache@v4
with:
path: |
erofs/arch/x86/boot/bzImage
key: bzImage-${{ steps.get_version_id.outputs.scm_version }}
- name: Build latest kernel
if: steps.cache-bzImage.outputs.cache-hit != 'true'
run: |
cd erofs && make -j32
- name: Upload bzImage
uses: actions/upload-artifact@v4
with:
name: erofs-bzImage
path: |
erofs/arch/x86/boot/bzImage
build-erofs-utils:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build erofs-utils
run: |
sudo apt -qq update
sudo apt-get install -y libfuse-dev libselinux1-dev libzstd-dev
curl -L https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz | tar -zxv
make BUILD_SHARED=no -C lz4-1.9.4 && lz4libdir=$(pwd)/lz4-1.9.4/lib
git clone git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git -b experimental
cd erofs-utils
mkdir output
./autogen.sh && ./configure --enable-debug --enable-werror --enable-fuse --with-selinux --with-libzstd \
--disable-multithreading \
--prefix=$(pwd)/output \
--with-lz4-incdir=${lz4libdir} --with-lz4-libdir=${lz4libdir} && \
make && make install
- name: Upload erofs-utils
uses: actions/upload-artifact@v4
with:
name: erofs-utils
path: |
erofs-utils/output
build-rootfs:
runs-on: ubuntu-22.04
needs: build-erofs-utils
steps:
- uses: actions/checkout@v4
- name: Cache rootfs images
id: cache-rootfs
uses: actions/cache@v4
with:
path: |
rootfs_4k.erofs.img
key: genrootfs-basic-overlay${{hashFiles('.github', 'basic-overlay', 'genrootfs-b')}}
- name: Download erofs-utils prebuilts
if: steps.cache-rootfs.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
name: erofs-utils
- name: Generate rootfs
if: steps.cache-rootfs.outputs.cache-hit != 'true'
run: |
chmod +x bin/mkfs.erofs bin/fsck.erofs
sudo apt update -y
sudo ./genrootfs-basic-overlay.sh rootfs_4k.erofs.img
qemu-basic-smoking:
runs-on: ubuntu-22.04
needs: [build-kernel, build-rootfs, build-erofs-utils]
strategy:
matrix:
pass: [0, 1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@v4
- name: Cache rootfs images
id: cache-rootfs
uses: actions/cache@v4
with:
path: |
rootfs_4k.erofs.img
key: genrootfs-basic-overlay${{hashFiles('.github', 'basic-overlay', 'genrootfs-b')}}
- name: Download erofs-utils prebuilts
uses: actions/download-artifact@v4
with:
name: erofs-utils
- name: Download bzImage
uses: actions/download-artifact@v4
with:
name: erofs-bzImage
- name: Test with QEMU
run: |
sudo apt update -y
sudo apt install -y qemu-kvm
sudo adduser "${USER}" kvm
chmod +x bin/mkfs.erofs bin/fsck.erofs bin/erofsfuse qemu-basic-test
./qemu-basic-test bzImage rootfs_4k.erofs.img ${{ matrix.pass }}
- name: Upload images if the test fails
uses: actions/upload-artifact@v4
if: failure()
with:
name: qemu-kbuild-images
path: |
*.img