]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
CI: add FreeBSD-15-amd64 build via firecracker 2837/head
authorMartin Matuska <martin@matuska.de>
Mon, 1 Jun 2026 08:06:05 +0000 (10:06 +0200)
committerMartin Matuska <martin@matuska.de>
Mon, 1 Jun 2026 08:37:21 +0000 (10:37 +0200)
.github/workflows/ci.yml
build/ci/github_actions/freebsd.sh [new file with mode: 0755]

index f95e1ad0a69c949e7744adb7fd224f9821de4a08..f0fe90122188162a9911653161bb934d93fb3c5d 100644 (file)
@@ -6,6 +6,27 @@ permissions:
   contents: read
 
 jobs:
+  FreeBSD:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        bs: [autotools, cmake]
+    steps:
+    - name: Build and test on a FreeBSD 15 firecracker VM
+      uses: acj/freebsd-firecracker-action@v0.9.1
+      with:
+        run-in-vm: |
+          chflags -R noschg / && \
+          fetch -o - https://download.freebsd.org/releases/amd64/15.0-RELEASE/base.txz | bsdtar -x -C / -f - && \
+          pkg bootstrap -y && \
+          cd firecracker-freebsd && \
+          env BS=${{ matrix.bs }} ./build/ci/github_actions/freebsd.sh prepare && \
+          env BS=${{ matrix.bs }} CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a autogen && \
+          env BS=${{ matrix.bs }} MAKE=gmake CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a configure && \
+          env BS=${{ matrix.bs }} MAKE=gmake MAKE_ARGS="-j 2" ./build/ci/build.sh -a build && \
+          env BS=${{ matrix.bs }} MAKE=gmake SKIP_TEST_RESTORE_ATIME=1 MAKE_ARGS="-j 2" ./build/ci/build.sh -a test && \
+          env BS=${{ matrix.bs }} ./build/ci/github_actions/freebsd.sh test && \
+          env BS=${{ matrix.bs }} MAKE=gmake MAKE_ARGS="-j 2" ./build/ci/build.sh -a install
   MacOS:
     runs-on: macos-15
     strategy:
diff --git a/build/ci/github_actions/freebsd.sh b/build/ci/github_actions/freebsd.sh
new file mode 100755 (executable)
index 0000000..fff74f6
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+set -eu
+
+if [ $# != 1 ]
+then
+       echo "Usage: $0 prepare | test"
+       exit 1
+fi
+
+if [ "$1" = "prepare" ]
+then
+       set -x -e
+       env ASSUME_ALWAYS_YES=yes pkg bootstrap -f
+       sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf
+       pkg update
+       mount -u -o acls /
+       mkdir /tmp_acl_nfsv4
+       MD=`mdconfig -a -t swap -s 128M`
+       newfs /dev/$MD
+       tunefs -N enable /dev/$MD
+       mount /dev/$MD /tmp_acl_nfsv4
+       chmod 1777 /tmp_acl_nfsv4
+       pkg install -y autoconf automake cmake gmake libiconv libtool pkgconf expat libxml2 liblz4 zstd
+elif [ "$1" = "test" ]
+then
+       set -e
+       echo "Additional NFSv4 ACL tests"
+       CURDIR=`pwd`
+       if [ "${BS}" = "cmake" ]
+       then
+               BIN_SUBDIR="bin"
+       else
+               BIN_SUBDIR=.
+       fi
+       BUILDDIR="${CURDIR}/build_ci/${BS}"
+       cd "$BUILDDIR"
+       TMPDIR=/tmp_acl_nfsv4 ${BIN_SUBDIR}/libarchive_test -r "${CURDIR}/libarchive/test" -v test_acl_platform_nfs4
+else
+       echo "Usage: $0 prepare | test"
+       exit 1
+fi