mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-27 12:39:09 +00:00
Add a FreeBSD build to CI (#8269)
Playing with this because it's interesting and I learned about this cool firecracker action. Related #3370
This commit is contained in:
parent
a7bb3a767c
commit
16b77e7fd4
2 changed files with 48 additions and 2 deletions
46
.github/workflows/ci.yml
vendored
46
.github/workflows/ci.yml
vendored
|
@ -551,6 +551,52 @@ jobs:
|
||||||
path: ${{ env.UV_WORKSPACE }}/target/debug/uv.exe
|
path: ${{ env.UV_WORKSPACE }}/target/debug/uv.exe
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
build-binary-freebsd:
|
||||||
|
needs: determine_changes
|
||||||
|
timeout-minutes: 10
|
||||||
|
if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
|
||||||
|
runs-on:
|
||||||
|
labels: ubuntu-latest
|
||||||
|
name: "build binary | freebsd"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: "Cross build"
|
||||||
|
run: |
|
||||||
|
# Install cross from `freebsd-firecracker`
|
||||||
|
wget -q -O cross https://github.com/acj/freebsd-firecracker/releases/download/v0.0.10/cross
|
||||||
|
chmod +x cross
|
||||||
|
mv cross /usr/local/bin/cross
|
||||||
|
|
||||||
|
cross build --target x86_64-unknown-freebsd
|
||||||
|
|
||||||
|
- name: Test in Firecracker VM
|
||||||
|
uses: acj/freebsd-firecracker-action@v0.2.0
|
||||||
|
with:
|
||||||
|
verbose: false
|
||||||
|
pre-run: |
|
||||||
|
# The exclude `*` prevents examination of directories so we need to
|
||||||
|
# include each parent directory of the binary
|
||||||
|
include_path="$(mktemp)"
|
||||||
|
cat <<EOF > $include_path
|
||||||
|
target
|
||||||
|
target/x86_64-unknown-freebsd
|
||||||
|
target/x86_64-unknown-freebsd/debug
|
||||||
|
target/x86_64-unknown-freebsd/debug/uv
|
||||||
|
EOF
|
||||||
|
|
||||||
|
rsync -r -e "ssh" \
|
||||||
|
--relative \
|
||||||
|
--copy-links \
|
||||||
|
--include-from "$include_path" \
|
||||||
|
--exclude "*" \
|
||||||
|
. firecracker:
|
||||||
|
run-in-vm: |
|
||||||
|
cp target/x86_64-unknown-freebsd/debug/uv uv
|
||||||
|
chmod +x uv
|
||||||
|
./uv --version
|
||||||
|
|
||||||
ecosystem-test:
|
ecosystem-test:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
needs: build-binary-linux
|
needs: build-binary-linux
|
||||||
|
|
|
@ -6,8 +6,8 @@ publish = false
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
[target.'cfg(not(any(target_arch = "s390x", target_arch = "powerpc64")))'.dependencies]
|
[target.'cfg(not(any(target_arch = "s390x", target_arch = "powerpc64", target_os = "freebsd")))'.dependencies]
|
||||||
flate2 = { version = "1.0.28", default-features = false, features = ["zlib-ng"] }
|
flate2 = { version = "1.0.28", default-features = false, features = ["zlib-ng"] }
|
||||||
|
|
||||||
[target.'cfg(any(target_arch = "s390x", target_arch = "powerpc64"))'.dependencies]
|
[target.'cfg(any(target_arch = "s390x", target_arch = "powerpc64", target_os = "freebsd"))'.dependencies]
|
||||||
flate2 = { version = "1.0.28", default-features = false, features = ["rust_backend"] }
|
flate2 = { version = "1.0.28", default-features = false, features = ["rust_backend"] }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue