forked from truenas/linux
-
Notifications
You must be signed in to change notification settings - Fork 2
176 lines (148 loc) · 5.87 KB
/
ci.yml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CI
on: [push, pull_request]
jobs:
pre_build:
runs-on: ubuntu-22.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Skip Duplicate Actions
id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
build_debug_kernel:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y build-essential gawk flex bison openssl dkms \
libelf-dev libudev-dev libpci-dev libiberty-dev autoconf dwarves \
libncurses-dev libssl-dev devscripts debhelper-compat
- name: Generate .config
run: |
rm -rf .git .gitattributes .gitignore
export EXTRAVERSION="-debug"
make ARCH=x86_64 defconfig
./scripts/kconfig/merge_config.sh .config ./scripts/package/truenas/debian_amd64.config
./scripts/kconfig/merge_config.sh .config ./scripts/package/truenas/truenas.config
./scripts/kconfig/merge_config.sh .config ./scripts/package/truenas/tn-debug.config
make syncconfig
make archprepare
./scripts/package/mkdebian
# Workaround to provide additional free space for kernel build
# https://github.com/actions/virtual-environments/issues/2840
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build Kernel
run: |
export EXTRAVERSION="-debug"
cp .config /tmp/
make distclean
mv /tmp/.config .config
make -j$(nproc) bindeb-pkg
- name: Prepare artifacts
run: |
mkdir -p debug-kernel
mv ../*.deb ./debug-kernel/
mv ../*.changes ./debug-kernel/
mv ../*.buildinfo ./debug-kernel/
cp .config ./debug-config
- name: Export artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.sha}}-debug
path: ./debug-kernel
- name: Status
run: |
echo "Status: ${{job.status}}"
build_production_kernel:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-22.04
steps:
- name: Reclaim disk space
# commands taken from https://github.com/openzfs/zfs/commit/e2909fae8f2c3b15459fd4c0acc1999c6907864b
run: |
sudo docker system prune --force --all --volumes
sudo rm -rf \
/usr/share/az* \
/usr/share/dotnet \
/usr/share/gradle* \
/usr/share/miniconda \
/usr/share/swift \
/var/lib/gems \
/var/lib/mysql \
/var/lib/snapd
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 8192
swap-size-mb: 10240
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y build-essential gawk flex bison openssl dkms \
libelf-dev libudev-dev libpci-dev libiberty-dev autoconf dwarves \
libncurses-dev libssl-dev libelf-dev libdw-dev systemtap-sdt-dev \
libunwind-dev libslang2-dev libperl-dev binutils-dev libiberty-dev \
python3-dev liblzma-dev libzstd-dev libcap-dev libnuma-dev \
libbabeltrace-dev openjdk-11-jdk devscripts libncurses-dev \
libssl-dev debhelper-compat libpfm4-dev libtraceevent-dev \
libcapstone-dev llvm-dev
- name: Generate .config
run: |
echo 'CONFIG_NTFS3_FS=y' >> scripts/package/truenas/truenas.config
echo '# CONFIG_NTFS3_64BIT_CLUSTER is not set' >> scripts/package/truenas/truenas.config
echo 'CONFIG_NTFS3_LZX_XPRESS=y' >> scripts/package/truenas/truenas.config
echo '# CONFIG_NTFS3_FS_POSIX_ACL is not set' >> scripts/package/truenas/truenas.config
cat scripts/package/truenas/truenas.config
rm -rf .git .gitattributes .gitignore
export EXTRAVERSION="-production"
make ARCH=x86_64 defconfig
./scripts/kconfig/merge_config.sh .config ./scripts/package/truenas/debian_amd64.config
./scripts/kconfig/merge_config.sh .config ./scripts/package/truenas/truenas.config
./scripts/kconfig/merge_config.sh .config ./scripts/package/truenas/tn-production.config
make syncconfig
make archprepare
./scripts/package/mkdebian
# Workaround to provide additional free space for kernel build
# https://github.com/actions/virtual-environments/issues/2840
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build Kernel
run: |
export EXTRAVERSION="-production"
cp .config /tmp/
make distclean
mv /tmp/.config .config
make -j$(nproc) bindeb-pkg
- name: Prepare artifacts
run: |
mkdir -p production-kernel
mv ../*.deb ./production-kernel/
mv ../*.changes ./production-kernel/
mv ../*.buildinfo ./production-kernel/
cp .config ./production-config
- name: Export artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.sha}}-production
path: ./production-kernel
- name: Status
run: |
echo "Status: ${{job.status}}"