Skip to content

Commit e1b1464

Browse files
committed
Merge branch 'ci' of github.com:lin1328/ruri into lin1328-ci
2 parents e1aaddf + a6e1a4e commit e1b1464

20 files changed

Lines changed: 897 additions & 538 deletions

.github/workflows/Ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Cmake and Autotools
2+
3+
on:
4+
push:
5+
paths:
6+
- CMakeLists.txt
7+
- configure.ac
8+
9+
jobs:
10+
Cmake:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
env:
15+
HOST_TRIPLE: x86_64-linux-gnu
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
- name: Install Dependencies
20+
run: |
21+
sudo apt update
22+
sudo apt install -y autoconf automake autopoint binutils bison build-essential cmake doxygen gettext gperf libc6-dev libtool ninja-build pkg-config po4a qemu-user-static tar texinfo texlive valgrind xz-utils
23+
24+
- name: libcap and libseccomp
25+
run: |
26+
# libcap
27+
wget https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.77.tar.gz
28+
tar -xzf libcap-2.77.tar.gz -C .
29+
30+
make -C libcap-2.77/libcap BUILD_CC=gcc \
31+
CC="${HOST_TRIPLE}-gcc" \
32+
SHARED=no GOLANG=no PAM_CAP=no DYNAMIC=no lib=lib \
33+
COPTS="-O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security" \
34+
prefix=$(pwd)/out \
35+
install
36+
37+
# libseccomp
38+
wget https://github.com/seccomp/libseccomp/releases/download/v2.6.0/libseccomp-2.6.0.tar.gz
39+
tar -xzf libseccomp-2.6.0.tar.gz -C .
40+
cd libseccomp-2.6.0
41+
42+
if [ ! -f configure ]; then
43+
autoreconf -fi
44+
fi
45+
./configure --disable-shared --enable-static \
46+
--prefix=$(pwd)/../out \
47+
${HOST_TRIPLE:+--host=${HOST_TRIPLE}}
48+
49+
make && make install
50+
51+
- name: ruri (Cmake)
52+
shell: bash
53+
run: |
54+
cmake -S . -B x86_64 \
55+
-DCMAKE_C_COMPILER="${HOST_TRIPLE}-gcc" \
56+
-DENABLE_STATIC=ON \
57+
-DCMAKE_FIND_ROOT_PATH=$(pwd)/out
58+
59+
cmake --build x86_64 --parallel
60+
./x86_64/ruri -v
61+
62+
- name: ruri (Autotools)
63+
shell: bash
64+
run: |
65+
autoreconf -fi
66+
./configure --enable-static ${HOST_TRIPLE:+--host=${HOST_TRIPLE}} \
67+
CPPFLAGS="-I$(pwd)/out/include" \
68+
LDFLAGS="-L$(pwd)/out/lib"
69+
70+
make -j$(nproc)
71+
./ruri -v && make distclean
72+
73+
- name: ruri (Autotools Android Core)
74+
shell: bash
75+
run: |
76+
sudo apt install -y qemu-user-static
77+
78+
./configure --enable-static --enable-coreonly --host=aarch64-linux-android \
79+
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang \
80+
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar \
81+
RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
82+
make && qemu-aarch64-static ./ruri -v

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ jobs:
5353
strategy:
5454
matrix:
5555
arch: [x86_64, x86, aarch64, armhf, armv7, ppc64le, loongarch64, riscv64, s390x]
56-
#arch: [x86_64, x86, aarch64, armhf, armv7, ppc64le, loongarch64, riscv64]
5756
env:
5857
ARCHITECTURE: ${{ matrix.arch }}
5958
steps:
60-
- name: Checkout repository
61-
uses: actions/checkout@v4
62-
6359
- name: Install Dependencies
6460
run: |
6561
sudo apt-get update
@@ -68,7 +64,7 @@ jobs:
6864
6965
- name: Build ruri for containers
7066
run: |
71-
cd build
67+
mkdir -p build && cd build
7268
git clone --depth 1 https://github.com/moe-hacker/ruri.git
7369
cd ruri
7470
cc -Wl,--gc-sections -static src/*.c src/easteregg/*.c -o ruri -lcap -lseccomp -lpthread
@@ -93,7 +89,7 @@ jobs:
9389
shell: bash
9490
run: |
9591
cd build
96-
cp build.sh "$ARCHITECTURE/build.sh"
92+
cp ruri/build/build.sh "$ARCHITECTURE/build.sh"
9793
sudo chmod +x ../ruri
9894
sudo chmod +x "$ARCHITECTURE/build.sh"
9995

.github/workflows/codeql.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,11 @@ jobs:
8383
run: |
8484
sudo apt update
8585
sudo apt install -y \
86-
make \
87-
clang \
88-
libseccomp-dev \
89-
libcap-dev \
90-
libc6-dev \
91-
binutils
92-
aclocal
93-
autoconf
86+
autoconf automake libtool make gcc \
87+
libseccomp-dev libcap-dev libc6-dev \
88+
binutils
89+
90+
autoreconf -fi
9491
./configure --enable-debug --enable-dev
9592
make
9693

.github/workflows/test.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- 'build/**'
1010
- 'test/**'
1111
- 'configure.ac'
12-
- 'Makefile'
1312
pull_request:
1413

1514
jobs:
@@ -24,10 +23,9 @@ jobs:
2423
run: |
2524
sudo apt update && sudo apt install -y git wget
2625
sudo apt install --no-install-recommends -y curl xz-utils \
27-
make \
28-
clang \
29-
libseccomp-dev \
30-
libcap-dev \
31-
libc6-dev \
32-
binutils qemu-user-static uidmap
33-
make -C test
26+
autoconf automake libtool make gcc \
27+
libseccomp-dev libcap-dev libc6-dev \
28+
binutils qemu-user-static uidmap
29+
30+
autoreconf -fi && ./configure
31+
make test

.gitignore

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Binary
22
ruri
3-
ruri-amd64.zip
4-
ruri-arm64.zip
3+
ruri-*.zip
54
# Editor configuration.
65
.vscode/
76
# Gdb log
@@ -22,27 +21,42 @@ debian/debhelper-build-stamp
2221
debian/files
2322
tmpdir*
2423
test-root
24+
25+
# Cmake
2526
cmake_install.cmake
2627
CMakeCache.txt
2728
CMakeFiles
28-
build/.cmake
29-
build/compile_commands.json
30-
build/Makefile
31-
build/build.ninja
32-
build/.ninja_deps
33-
build/.ninja_log
29+
.cmake
30+
*.json
31+
build.ninja
32+
.ninja_deps
33+
.ninja_log
34+
35+
# Automake
36+
build-aux
3437
autom4te.cache
38+
.deps
39+
.dirstamp
3540
aclocal.m4
3641
config.log
3742
config.status
3843
config.h
3944
config.h.in
45+
config.h.in~
4046
compile
4147
configure~
4248
install-sh
4349
missing
4450
configure
4551
Makefile.in
52+
depcomp
53+
config.guess
54+
config.sub
55+
test-driver
56+
*.Po
57+
58+
*.o
59+
Makefile
4660

4761
# VitePress
4862
docs/.vitepress/cache

0 commit comments

Comments
 (0)