mirror of
https://github.com/gorules/zen.git
synced 2026-11-29 08:06:51 +00:00
* fix(engine): keep decision table analysis memory and time in proportion to the table Schema queries no longer run table verification; graph table checks are deferred to diagnostics. Gap search and unreachable-rule cover run on per-dimension bitsets when the table is small enough to index densely, and on the set-based path otherwise. Missing cases are merged on interned ids and rendered lazily. Compression works on borrowed rows and interned cell ids, assigned once per round. Small string sets are held inline or as a sorted list instead of a tree. Findings are unchanged: the previous implementations stay as test-only references and are compared on generated tables, and tests/table_scaling.rs bounds peak memory with a counting allocator. * fix(nodejs): accept bytes and JSON text in Workspace setDocument, setPolicy and enhanceGraphTrace Documents with more than one million JSON values were rejected by the object conversion limit, which a two-column decision table reaches at 250,000 rows. Buffers and strings are parsed directly, and objects are converted without that limit. * ci: pin Rust to 1.99.0 Rust 1.100 passes one -L dependency directory per dependency, which pushes the rustc command for zen-engine past the Windows command-line limit when sccache spawns it (os error 206). Every workflow that installed stable now installs 1.99.0; miri stays on nightly. * ci: pin the UniFFI native build to Rust 1.99.0 actions-rust-cross installs its own toolchain and defaults to stable, so the Windows and macOS UniFFI builds were still on 1.100.
168 lines
5.4 KiB
YAML
168 lines
5.4 KiB
YAML
name: Go
|
|
env:
|
|
WORKING_DIRECTORY: bindings/c
|
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- 'bindings/c/**'
|
|
- 'core/**'
|
|
- 'test-data/**'
|
|
- '.github/workflows/go.yaml'
|
|
push:
|
|
tags:
|
|
- 'go-v*'
|
|
|
|
permissions: write-all
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
settings:
|
|
- host: macos-latest
|
|
target: 'x86_64-apple-darwin'
|
|
- host: macos-latest
|
|
target: 'aarch64-apple-darwin'
|
|
- host: ubuntu-latest
|
|
target: 'x86_64-unknown-linux-gnu'
|
|
- host: ubuntu-latest
|
|
target: 'aarch64-unknown-linux-gnu'
|
|
- host: ubuntu-latest
|
|
target: 'x86_64-pc-windows-gnu'
|
|
|
|
name: ${{ matrix.settings.target }}
|
|
runs-on: ${{ matrix.settings.host }}
|
|
defaults:
|
|
run:
|
|
working-directory: ${{ env.WORKING_DIRECTORY }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: 1.99.0
|
|
override: true
|
|
target: ${{ matrix.settings.target }}
|
|
- uses: ./.github/actions/setup-rust
|
|
with:
|
|
shared-key: go-${{ matrix.settings.target }}
|
|
zig: ${{ matrix.settings.host == 'ubuntu-latest' }}
|
|
sccache-bucket: ${{ secrets.SCCACHE_S3_BUCKET }}
|
|
sccache-region: ${{ secrets.SCCACHE_AWS_REGION }}
|
|
sccache-role-arn: ${{ secrets.SCCACHE_AWS_ROLE_ARN }}
|
|
|
|
- name: Build (zig, linux)
|
|
if: ${{ matrix.settings.host == 'ubuntu-latest' && contains(matrix.settings.target, 'linux') }}
|
|
working-directory: bindings/c
|
|
run: cargo zigbuild --release --all-features --target ${{ matrix.settings.target }}.${{ env.GLIBC_VERSION }} --locked
|
|
- name: Build (zig, windows)
|
|
if: ${{ contains(matrix.settings.target, 'windows') }}
|
|
working-directory: bindings/c
|
|
run: cargo zigbuild --release --all-features --target ${{ matrix.settings.target }} --locked
|
|
- name: Build (native)
|
|
if: ${{ matrix.settings.host != 'ubuntu-latest' }}
|
|
uses: marcopolo/cargo@master
|
|
with:
|
|
working-directory: bindings/c
|
|
args: --release --all-features --target=${{ matrix.settings.target }} --locked
|
|
command: build
|
|
|
|
- name: List folder
|
|
run: ls -lh ../../target/${{ matrix.settings.target }}/release
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.settings.target }}
|
|
path: target/${{ matrix.settings.target }}/release/libzen_ffi.a
|
|
if-no-files-found: error
|
|
copy-common:
|
|
name: Upload common file
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: common
|
|
path: bindings/c/zen_engine.h
|
|
if-no-files-found: error
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
environment: release
|
|
if: "github.ref_type == 'tag' || github.event_name == 'workflow_dispatch'"
|
|
needs:
|
|
- build
|
|
- copy-common
|
|
steps:
|
|
- name: Checkout zen-go
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: gorules/zen-go
|
|
persist-credentials: false
|
|
token: ${{ secrets.PAT }}
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Move artifacts
|
|
run: |
|
|
mv artifacts/aarch64-apple-darwin/libzen_ffi.a deps/darwin_arm64/
|
|
mv artifacts/x86_64-apple-darwin/libzen_ffi.a deps/darwin_amd64/
|
|
mv artifacts/aarch64-unknown-linux-gnu/libzen_ffi.a deps/linux_arm64/
|
|
mv artifacts/x86_64-unknown-linux-gnu/libzen_ffi.a deps/linux_amd64/
|
|
mv artifacts/x86_64-pc-windows-gnu/libzen_ffi.a deps/windows_amd64/libzen_ffi.a
|
|
rm -f deps/windows_amd64/libzen_ffi.lib
|
|
mv artifacts/common/zen_engine.h zen_engine.h
|
|
rm -rf artifacts
|
|
|
|
- name: Set branch name
|
|
run: |
|
|
echo "BRANCH_NAME=chore/${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_ENV
|
|
|
|
- run: git config -l
|
|
|
|
- name: Commit
|
|
run: |
|
|
BRANCH_NAME="${{ env.BRANCH_NAME }}"
|
|
git checkout -b $BRANCH_NAME
|
|
# Setup the committers identity.
|
|
git config user.email "bot@gorules.io"
|
|
git config user.name "Bot GoRules"
|
|
git config http.postBuffer 524288000
|
|
git config http.lowSpeedTime 600
|
|
|
|
# Commit the changes and push the feature branch to origin
|
|
git add .
|
|
git commit -m "chore: update deps"
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
repository: gorules/zen-go
|
|
github_token: ${{ secrets.PAT }}
|
|
branch: ${{ env.BRANCH_NAME }}
|
|
- name: Create PR
|
|
run: |
|
|
BRANCH_NAME="${{ env.BRANCH_NAME }}"
|
|
# Store the PAT in a file that can be accessed by the
|
|
# GitHub CLI.
|
|
echo "${{ secrets.PAT }}" > token.txt
|
|
|
|
# Authorize GitHub CLI for the current repository and
|
|
# create a pull-requests containing the updates.
|
|
echo "Authorizing for PR"
|
|
gh auth login --with-token < token.txt
|
|
gh pr create \
|
|
--body "" \
|
|
--title "chore: update deps" \
|
|
--head "$BRANCH_NAME" \
|
|
--base "master"
|