AnvilDB uses GitHub Actions for continuous integration, releases, and wrapper distribution.
| Workflow | File | Trigger | Purpose |
|---|---|---|---|
| Tests | .github/workflows/tests.yml |
Push to main, PRs |
Run Rust + PHP tests |
| Release | .github/workflows/release.yml |
Tag v* |
Cross-compile and create GitHub Release |
| Miri | .github/workflows/miri.yml |
Push to main, PRs |
Memory safety checks with Miri |
Every push to main and every pull request triggers:
- Rust tests —
cargo testonubuntu-latest - PHP tests — PHPUnit on PHP 8.1, 8.2, 8.3, and 8.4
PHP tests depend on Rust tests passing first. The native library is built automatically during CI.
Push / PR
│
▼
Rust tests (cargo test)
│ pass
▼
PHP tests (4 PHP versions in parallel)
│ all pass
▼
✓ Green
- Checkout the repository
- Install Rust toolchain and build the native library (
cargo build) - Setup PHP with FFI extension enabled
- Install Composer dependencies from
wrappers/php/ - Run PHPUnit from
wrappers/php/
Runs Miri (Rust's undefined behavior detector) on unit tests using the nightly toolchain. This catches memory safety issues that normal tests might miss.
Releases are fully automated. To publish a new version:
- Make sure
mainis stable — all tests passing, changes merged - Update the version in
core/Cargo.tomlif needed - Create and push a tag:
git tag v0.5.0 git push origin v0.5.0
That's it. The workflow automatically:
- Cross-compiles for all 5 target platforms
- Packages each binary as a
.tar.gzarchive - Creates a GitHub Release with auto-generated notes
- Attaches all archives to the release
Each release archive contains two artifacts: the FFI library and the anvildb-server binary (used as fallback when ext-ffi is unavailable).
| Target | OS | Library | Binary |
|---|---|---|---|
x86_64-unknown-linux-gnu |
Ubuntu | libanvildb.so |
anvildb-server |
aarch64-unknown-linux-gnu |
Ubuntu (cross) | libanvildb.so |
anvildb-server |
x86_64-apple-darwin |
macOS 15 | libanvildb.dylib |
anvildb-server |
aarch64-apple-darwin |
macOS 14 (Apple Silicon) | libanvildb.dylib |
anvildb-server |
x86_64-pc-windows-msvc |
Windows | anvildb.dll |
anvildb-server.exe |
- aarch64-linux uses
gcc-aarch64-linux-gnuas a cross-linker - macOS targets run on native runners (x86 on macos-13, ARM on macos-14)
- Windows builds use MSVC toolchain
Use Semantic Versioning:
- Patch (
v0.1.1): bug fixes, no API changes - Minor (
v0.2.0): new features, backwards compatible - Major (
v1.0.0): breaking API changes
The monorepo publishes each wrapper to its own read-only repository via git subtree split. This allows language-specific package managers to install the wrapper without pulling the entire monorepo.
Monorepo (kevinsillo/anvildb)
│
│ git subtree split --prefix=wrappers/php
│
▼
Read-only repo (kevinsillo/anvildb-php)
│
│ + precompiled binaries from GitHub Release
│
▼
Packagist (composer require kevinsillo/anvildb)
| Wrapper | Repository | Package Manager |
|---|---|---|
| PHP | kevinsillo/anvildb-php | Packagist |
- Create the wrapper code in
wrappers/<language>/ - Create an empty read-only repository on GitHub (
kevinsillo/anvildb-<language>) - Add a subtree split step to the CI workflow for the new prefix
- Configure the target package manager (PyPI, npm, etc.) to pull from the read-only repo
Feature/fix branch
│
▼
Pull Request → CI runs tests (Rust + PHP 8.1–8.4) + Miri
│
▼
Merge to main
│
▼
git tag v0.x.x → push tag
│
▼
Release workflow → cross-compile → GitHub Release with binaries
│
▼
Subtree split → push to wrapper repos → package managers