Skip to content

Build and Sync

Build and Sync #193

Workflow file for this run

name: Build and Sync
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Update z-core submodule
run: |
git submodule update --remote --merge
echo "Submodule updated to latest remote version."
- name: Test Z-Scanner
run: |
echo "Running scanner on examples/..."
mkdir -p include
python3 z-core/zscanner.py examples/ include/z_registry.h
if [ -f "include/z_registry.h" ]; then
echo "Scanner successfully generated registry!"
cat include/z_registry.h
else
echo "::error::Scanner failed to generate registry file."
exit 1
fi
rm -rf include
- name: Build Library
run: make bundle
- name: Run Unit Tests
run: |
echo "Running C and C++ Test Suites..."
# Runs the 'test' target from your Makefile.
# If it fails (non-zero exit), we print an error and exit.
make test || { echo "::error::Unit tests failed! Check the logs above for assertion errors."; exit 1; }
- name: Commit and Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Auto-update: Bump z-core and regenerate zvec.h [skip ci]"
file_pattern: '.'