From 5dd5c5caf35a868159d302afe05410a754b71c06 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 16 Jul 2024 18:53:19 +0800 Subject: [PATCH] ci: add FreeBSD build (#15) --- .github/workflows/CI.yml | 45 ++++++++++++++++++++++++++++++++++++++ packages/core/package.json | 1 + 2 files changed, 46 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c4668e3..67ffbf5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -155,6 +155,50 @@ jobs: ./packages/core/*.wasm if-no-files-found: error + build-freebsd: + name: Build FreeBSD + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build + id: build + uses: cross-platform-actions/action@v0.25.0 + env: + DEBUG: napi:* + RUSTUP_IO_THREADS: 1 + with: + operating_system: freebsd + version: '14.0' + memory: 8G + cpu_count: 3 + environment_variables: 'DEBUG RUSTUP_IO_THREADS' + shell: bash + run: | + sudo pkg install -y -f curl node libnghttp2 npm + curl https://sh.rustup.rs -sSf --output rustup.sh + sh rustup.sh -y --profile minimal --default-toolchain stable + source "$HOME/.cargo/env" + echo "~~~~ rustc --version ~~~~" + rustc --version + echo "~~~~ node -v ~~~~" + node -v + pwd + ls -lah + whoami + env + sudo corepack enable + pnpm install + pnpm build --target x86_64-unknown-freebsd + pnpm --filter="\!integrate-ava" run test + rm -rf node_modules + rm -rf target + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-freebsd + path: ./packages/core/*.node + if-no-files-found: error + test-macOS-windows-binding: name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} needs: @@ -306,6 +350,7 @@ jobs: - lint - test-macOS-windows-binding - test-linux-binding + - build-freebsd # - test-wasi steps: - uses: actions/checkout@v4 diff --git a/packages/core/package.json b/packages/core/package.json index dff1f92..1458e4c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -42,6 +42,7 @@ "aarch64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", + "x86_64-unknown-freebsd", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl",