Skip to content

Commit 8925c1f

Browse files
committed
new(ci): use zig compiler instead of relying on centos7.
Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 8a3cb76 commit 8925c1f

File tree

1 file changed

+13
-32
lines changed

1 file changed

+13
-32
lines changed

.github/workflows/reusable_build_packages.yaml

+13-32
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,23 @@ jobs:
5454
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
5555
runs-on: ${{ (inputs.arch == 'aarch64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-latest' }}
5656
needs: [build-modern-bpf-skeleton]
57-
container: centos:7
5857
steps:
5958
# Always install deps before invoking checkout action, to properly perform a full clone.
60-
- name: Fix mirrors to use vault.centos.org
61-
run: |
62-
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
63-
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
64-
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
65-
66-
- name: Install scl repos
67-
run: |
68-
yum -y install centos-release-scl
69-
70-
- name: Fix new mirrors to use vault.centos.org
71-
run: |
72-
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
73-
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
74-
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
75-
76-
- name: Fix arm64 scl repos to use correct mirror
77-
if: inputs.arch == 'aarch64'
59+
- name: Install build deps
7860
run: |
79-
sed -i 's/vault.centos.org\/centos/vault.centos.org\/altarch/g' /etc/yum.repos.d/CentOS-SCLo-scl*.repo
61+
sudo apt update && sudo apt install -y --no-install-recommends ca-certificates cmake curl wget build-essential git pkg-config autoconf automake libtool libelf-dev m4 rpm
8062
81-
- name: Install build deps
63+
- name: Install zig
8264
run: |
83-
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++
84-
source /opt/rh/devtoolset-9/enable
85-
yum install -y wget git make m4 rpm-build elfutils-libelf-devel perl-IPC-Cmd devtoolset-9-libasan-devel devtoolset-9-libubsan-devel
65+
curl -L -o zig.tar.gz https://ziglang.org/download/0.13.0/zig-linux-$(uname -m)-0.13.0.tar.xz
66+
tar -xvf zig.tar.gz
67+
sudo mkdir -p /usr/local/zig/
68+
sudo cp -R zig-linux-$(uname -m)-0.13.0/* /usr/local/zig/
69+
echo "/usr/local/zig" >> $GITHUB_PATH
70+
echo "CC=zig cc -target $(uname -m)-linux-gnu.2.17" >> $GITHUB_ENV
71+
echo "CXX=zig c++ -target $(uname -m)-linux-gnu.2.17" >> $GITHUB_ENV
72+
echo "AR=zig ar" >> $GITHUB_ENV
73+
echo "RANLIB=zig ranlib" >> $GITHUB_ENV
8674
8775
- name: Checkout
8876
# It is not possible to upgrade the checkout action to versions >= v4.0.0 because of incompatibilities with centos 7's libc.
@@ -94,17 +82,12 @@ jobs:
9482
name: bpf_probe_${{ inputs.arch }}.skel.h
9583
path: /tmp
9684

97-
- name: Install updated cmake
98-
run: |
99-
curl -L https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz \
100-
| tar --directory=/usr --strip-components=1 -xzp
101-
10285
- name: Prepare project
10386
run: |
104-
source /opt/rh/devtoolset-9/enable
10587
cmake -B build -S . \
10688
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
10789
-DUSE_BUNDLED_DEPS=On \
90+
-DUSE_BUNDLED_LIBELF=On \
10891
-DFALCO_ETC_DIR=/etc/falco \
10992
-DMODERN_BPF_SKEL_DIR=/tmp \
11093
-DBUILD_DRIVER=Off \
@@ -114,12 +97,10 @@ jobs:
11497
11598
- name: Build project
11699
run: |
117-
source /opt/rh/devtoolset-9/enable
118100
cmake --build build --target falco -j6
119101
120102
- name: Build packages
121103
run: |
122-
source /opt/rh/devtoolset-9/enable
123104
cmake --build build --target package
124105
125106
- name: Upload Falco tar.gz package

0 commit comments

Comments
 (0)