165 lines
5.8 KiB
YAML
165 lines
5.8 KiB
YAML
name: Build libfuse
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
# Main build and test job
|
|
build-and-test:
|
|
name: Build and Test
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: debian:trixie
|
|
|
|
services:
|
|
apt-cacher-ng:
|
|
image: sameersbn/apt-cacher-ng:latest
|
|
ports:
|
|
- 3142:3142
|
|
options: >-
|
|
--health-cmd "wget --quiet --tries=1 --spider http://localhost:3142/acng-report.html"
|
|
--health-interval 30s
|
|
--health-timeout 10s
|
|
--health-retries 3
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure apt to use cacher
|
|
run: |
|
|
echo 'Acquire::http::Proxy "http://localhost:3142";' | sudo tee /etc/apt/apt.conf.d/01proxy
|
|
echo 'Acquire::https::Proxy "http://localhost:3142";' | sudo tee -a /etc/apt/apt.conf.d/01proxy
|
|
echo 'Acquire::http::Proxy::security.debian.org "DIRECT";' | sudo tee -a /etc/apt/apt.conf.d/01proxy
|
|
echo 'Acquire::http::Proxy::deb.debian.org "DIRECT";' | sudo tee -a /etc/apt/apt.conf.d/01proxy
|
|
echo 'Acquire::http::Proxy::archive.ubuntu.com "DIRECT";' | sudo tee -a /etc/apt/apt.conf.d/01proxy
|
|
echo 'Acquire::http::Proxy::security.ubuntu.com "DIRECT";' | sudo tee -a /etc/apt/apt.conf.d/01proxy
|
|
|
|
- name: Wait for apt-cacher-ng to be ready
|
|
run: |
|
|
timeout 60 bash -c 'until wget --quiet --tries=1 --spider http://localhost:3142/acng-report.html; do sleep 2; done'
|
|
|
|
- name: Set up build environment
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y \
|
|
build-essential \
|
|
cmake \
|
|
pkg-config \
|
|
libssl-dev \
|
|
libfuse-dev \
|
|
fuse3 \
|
|
meson \
|
|
ninja-build \
|
|
git \
|
|
wget \
|
|
curl \
|
|
dpkg-dev
|
|
|
|
- name: Download libfuse source
|
|
run: |
|
|
# Download libfuse 3.10.0 source (required for composefs compatibility)
|
|
# Note: Using 3.10.0 specifically to satisfy composefs dependency requirement
|
|
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.10.0/fuse-3.10.0.tar.xz
|
|
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.10.0/fuse-3.10.0.tar.xz.asc
|
|
tar -xf fuse-3.10.0.tar.xz
|
|
cd fuse-3.10.0
|
|
|
|
- name: Verify libfuse signature
|
|
run: |
|
|
# Install signify for signature verification
|
|
apt-get install -y signify-openbsd
|
|
# Download and verify the signature
|
|
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.10.0/fuse-3.10.pub
|
|
signify -V -m fuse-3.10.0.tar.xz -p fuse-3.10.pub
|
|
|
|
- name: Configure and build libfuse
|
|
run: |
|
|
cd fuse-3.10.0
|
|
mkdir build && cd build
|
|
meson setup --prefix=/usr --libdir=lib/x86_64-linux-gnu ..
|
|
ninja
|
|
|
|
- name: Run libfuse tests
|
|
run: |
|
|
cd fuse-3.10.0/build
|
|
# Install pytest for running tests
|
|
apt-get install -y python3-pytest
|
|
# Run tests (most can run as regular user)
|
|
python3 -m pytest test/ || echo "Some tests may require root privileges"
|
|
|
|
- name: Install libfuse
|
|
run: |
|
|
cd fuse-3.10.0/build
|
|
ninja install
|
|
ldconfig
|
|
|
|
- name: Create Debian package
|
|
run: |
|
|
# Create a simple .deb package
|
|
mkdir -p libfuse3-3_3.10.0-1_amd64/DEBIAN
|
|
mkdir -p libfuse3-3_3.10.0-1_amd64/usr/lib/x86_64-linux-gnu
|
|
mkdir -p libfuse3-3_3.10.0-1_amd64/usr/include/fuse3
|
|
mkdir -p libfuse3-3_3.10.0-1_amd64/usr/lib/pkgconfig
|
|
|
|
# Copy libraries
|
|
cp /usr/lib/x86_64-linux-gnu/libfuse3.so.3.10.0 libfuse3-3_3.10.0-1_amd64/usr/lib/x86_64-linux-gnu/
|
|
ln -s libfuse3.so.3.10.0 libfuse3-3_3.10.0-1_amd64/usr/lib/x86_64-linux-gnu/libfuse3.so.3
|
|
ln -s libfuse3.so.3 libfuse3-3_3.10.0-1_amd64/usr/lib/x86_64-linux-gnu/libfuse3.so
|
|
|
|
# Copy headers
|
|
cp -r /usr/include/fuse3/* libfuse3-3_3.10.0-1_amd64/usr/include/fuse3/
|
|
|
|
# Copy pkg-config files
|
|
cp /usr/lib/pkgconfig/fuse3.pc libfuse3-3_3.10.0-1_amd64/usr/lib/pkgconfig/
|
|
|
|
# Create control file
|
|
cat > libfuse3-3_3.10.0-1_amd64/DEBIAN/control << EOF
|
|
Package: libfuse3-3
|
|
Version: 3.10.0-1
|
|
Section: libs
|
|
Priority: optional
|
|
Architecture: amd64
|
|
Depends: libc6 (>= 2.17)
|
|
Description: Filesystem in Userspace (FUSE) v3 library
|
|
FUSE (Filesystem in Userspace) is a simple interface for userspace
|
|
programs to export a virtual filesystem to the Linux kernel. FUSE
|
|
also aims to provide a secure method for non privileged users to
|
|
create and mount their own filesystem implementations.
|
|
.
|
|
This package contains the FUSE v3 shared library.
|
|
EOF
|
|
|
|
# Build the package
|
|
dpkg-deb --build libfuse3-3_3.10.0-1_amd64
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: libfuse3-3-package
|
|
path: libfuse3-3_3.10.0-1_amd64.deb
|
|
retention-days: 30
|
|
|
|
- name: Test package installation
|
|
run: |
|
|
# Test that the package can be installed
|
|
dpkg -i libfuse3-3_3.10.0-1_amd64.deb || true
|
|
apt-get install -f -y
|
|
|
|
# Verify the library is available
|
|
ldconfig -p | grep libfuse3
|
|
pkg-config --exists fuse3 && echo "fuse3.pc found" || echo "fuse3.pc not found"
|
|
|
|
- name: Show apt-cacher statistics
|
|
run: |
|
|
echo "=== Apt-Cacher-NG Statistics ==="
|
|
wget -qO- http://localhost:3142/acng-report.html | grep -E "(Hits|Misses|Bytes|Files)" || echo "Statistics not available"
|
|
|
|
- name: Clean up proxy configuration
|
|
if: always()
|
|
run: |
|
|
rm -f /etc/apt/apt.conf.d/01proxy
|