From 6c608f5f7075037ba79eddf7e1be361f47941598 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 24 Jan 2021 10:30:54 +0800 Subject: [PATCH] add freebsd ci (#250) --- .github/workflows/freebsd.yml | 42 +++++++++++++++++++++++++++++++++++ packages/g/giflib/xmake.lua | 2 +- packages/l/libtiff/xmake.lua | 2 +- packages/l/libwebp/xmake.lua | 2 +- packages/z/zlib/xmake.lua | 2 +- scripts/test.lua | 5 +++++ 6 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/freebsd.yml diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml new file mode 100644 index 000000000..b3d196c2f --- /dev/null +++ b/.github/workflows/freebsd.yml @@ -0,0 +1,42 @@ +name: FreeBSD + +on: + pull_request: + push: + release: + types: [published] + +jobs: + build: + + strategy: + matrix: + os: [macOS-latest] + kind: [static, shared] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + + - name: Tests + uses: vmactions/freebsd-vm@v0.1.0 + with: + usesh: true + prepare: pkg install -y git curl unzip gmake llvm gsed bash perl5 + run: | + git clone --recurse-submodules https://github.com/xmake-io/xmake.git /tmp/xmake -b dev + cd /tmp/xmake + gmake -j4 + gmake install + export XMAKE_ROOT=y + git clone https://github.com/xmake-io/xmake-repo.git /tmp/xmake-repo -b ${{ env.GITHUB_REF_SLUG }} --depth 2 + cd /tmp/xmake-repo + xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} + + diff --git a/packages/g/giflib/xmake.lua b/packages/g/giflib/xmake.lua index 7bb3480d8..994bbe125 100644 --- a/packages/g/giflib/xmake.lua +++ b/packages/g/giflib/xmake.lua @@ -13,7 +13,7 @@ package("giflib") add_deps("cgetopt") end - on_install("linux", "macosx", "windows", "mingw", "android", "iphoneos", function (package) + on_install("linux", "macosx", "windows", "mingw", "android", "iphoneos", "bsd", function (package) local lib_sources = {"dgif_lib.c", "egif_lib.c", "gifalloc.c", "gif_err.c", "gif_font.c", "gif_hash.c", "openbsd-reallocarray.c"} local kind = "static" if package:config("shared") then diff --git a/packages/l/libtiff/xmake.lua b/packages/l/libtiff/xmake.lua index 40671217c..6b755d912 100644 --- a/packages/l/libtiff/xmake.lua +++ b/packages/l/libtiff/xmake.lua @@ -23,7 +23,7 @@ package("libtiff") import("package.tools.cmake").install(package, configs) end) - on_install("macosx", "linux", function (package) + on_install("macosx", "linux", "bsd", function (package) local configs = {"--disable-dependency-tracking", "--disable-lzma", "--disable-webp", "--disable-jpeg", "--disable-zstd", "--disable-old-jpeg", "--disable-jbig", "--disable-pixarlog", "--without-x"} if package:config("shared") then table.insert(configs, "--enable-shared=yes") diff --git a/packages/l/libwebp/xmake.lua b/packages/l/libwebp/xmake.lua index cc47fbce8..30f157da0 100644 --- a/packages/l/libwebp/xmake.lua +++ b/packages/l/libwebp/xmake.lua @@ -23,7 +23,7 @@ package("libwebp") add_syslinks("pthread") end - on_install("linux", "macosx", "windows", "mingw", function (package) + on_install("linux", "macosx", "windows", "mingw", "bsd", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/z/zlib/xmake.lua b/packages/z/zlib/xmake.lua index f2d9fdf9c..e50a1ff2d 100644 --- a/packages/z/zlib/xmake.lua +++ b/packages/z/zlib/xmake.lua @@ -23,7 +23,7 @@ package("zlib") os.cp("*.h", package:installdir("include")) end) - on_install("macosx", function (package) + on_install("macosx", "bsd", function (package) import("package.tools.autoconf").install(package, {"--static"}) end) diff --git a/scripts/test.lua b/scripts/test.lua index a74ad7f9d..c77519d3d 100644 --- a/scripts/test.lua +++ b/scripts/test.lua @@ -146,6 +146,11 @@ function main(...) return end + -- we only test one package because freebsd ci is too slow + if is_host("bsd") then + packages = {packages[1]} + end + -- prepare test project local repodir = os.curdir() local workdir = path.join(os.tmpdir(), "xmake-repo")