mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-23 17:28:23 +00:00
## Summary Re-add the static build feature option to bundle postgres dependency into the binary. It simplify the installation because now to run the node the operator doesn't need to have postgres dependencies installed on its system. ## What changed ? * Added a `static` feature that can be activated to add the extra dependencies during the build. * A task that run every time a dependency has been modified so we can make sure the build with the feature is still working correctly. (we are assuming simple change in the code won't have an impact on it because postgres is being used in diesel which is not a direct dependecy to datahaven).
45 lines
No EOL
1.1 KiB
YAML
45 lines
No EOL
1.1 KiB
YAML
name: DataHaven Operator Static Build
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
# Only check the build if we are adding a dependency to save runner time
|
|
- 'operator/Cargo.toml'
|
|
- 'operator/Cargo.lock'
|
|
|
|
jobs:
|
|
build-node:
|
|
name: Build operator binary
|
|
runs-on:
|
|
group: DH-runners
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
CARGO_INCREMENTAL: "0"
|
|
CARGO_TERM_COLOR: always
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
defaults:
|
|
run:
|
|
working-directory: ./operator
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 1
|
|
|
|
- uses: ./.github/workflows/actions/setup-env
|
|
with:
|
|
cache-key: BUILD-RELEASE
|
|
install-deps: false
|
|
skip-libpq: true
|
|
|
|
- name: Set build flags
|
|
run: echo "RUSTFLAGS=-C linker=clang -C link-arg=-fuse-ld=mold" >> $GITHUB_ENV
|
|
|
|
- name: Build node binary
|
|
run: |
|
|
cargo build --release --locked --features fast-runtime,static
|
|
|
|
- name: Test binary
|
|
run: |
|
|
ldd ./target/release/datahaven-node
|
|
./target/release/datahaven-node --version |