Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Merge main (#129, the shared FreeBSD CI template) into pr/freebsd-release

Brandon Thomas0aba6ef6e4c3
diff --cc .github/workflows/freebsd.yml
index d443b4e47,9dc8fe0b9..0cbc97bab
--- a/.github/workflows/freebsd.yml
+++ b/.github/workflows/freebsd.yml
@@@ -40,45 -37,12 +40,43 @@@ jobs
# Nothing to bring back; copying the target dir out of the VM fails on large builds.
copyback: false
prepare: |
- pkg install -y bash curl git pkgconf cmake python3 libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
+ pkg install -y git curl pkgconf cmake python3 libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
+ curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal
run: |
. "$HOME/.cargo/env"
- # The checkout copied into the VM belongs to another user.
- git config --global --add safe.directory "$PWD"
+ # The checkout is synced in under another owner; let tests that call git read it.
+ git config --global --add safe.directory "*"
rustc --version
- # Linking many test binaries at once can run the VM out of memory.
- export CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 CARGO_BUILD_JOBS=4
- cargo build --workspace --all-targets --locked
- cargo test --workspace --locked
+ CARGO_PROFILE_DEV_DEBUG=0 cargo build --workspace --all-targets --locked
+ CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked
+
+ package:
+ name: FreeBSD 14 (package)
+ # The release build takes a while: only for PRs that touch FreeBSD packaging (or dependencies)
+ # and on demand, not on every push to main.
+ if: github.event_name != 'push'
+ runs-on: ubuntu-latest
+ timeout-minutes: 150
+ steps:
+ - uses: actions/checkout@v4
+ - name: Package in a FreeBSD VM
+ uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc
+ with:
+ release: "14.3"
+ usesh: true
+ mem: 12288
+ prepare: |
+ pkg install -y bash curl git pkgconf cmake python3 libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
+ run: |
+ . "$HOME/.cargo/env"
+ git config --global --add safe.directory "$PWD"
+ # Build outside the checkout so only dist/ is copied back out of the VM.
+ export CARGO_TARGET_DIR=/var/tmp/vectorcraft-target CARGO_BUILD_JOBS=4
+ bash packaging/freebsd/package.sh
+ tar -tzf dist/release/vectorcraft-*-freebsd-x86_64.tar.gz | grep -E '/bin/vectorcraft$|/bin/vectorcraft-cli$|/share/applications/|/share/icons/hicolor/|/share/doc/vectorcraft/NOTICE'
+ - uses: actions/upload-artifact@v4
+ with:
+ name: freebsd-package
+ path: dist/release/*
+ if-no-files-found: error