Build & Test macOS x86_64 workflow (chdb-io/chdb)
The Build & Test macOS x86_64 workflow from chdb-io/chdb, explained and optimized by Latchkey.
CI health: A - excellent
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Build & Test macOS x86_64 workflow from the chdb-io/chdb repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Build & Test macOS x86_64
on:
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Release Version Tag'
required: true
release:
types: [created]
push:
branches:
- main
paths-ignore:
- '**/*.md'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- '**/*.md'
jobs:
test_datastore:
name: Test DataStore (macOS x86_64)
runs-on: macos-15-intel
if: ${{ !github.event.pull_request.draft }}
timeout-minutes: 120
steps:
- name: Check machine architecture
run: |
echo "=== Machine Architecture Information ==="
echo "Machine type: $(uname -m)"
echo "Architecture: $(arch)"
echo "System info: $(uname -a)"
- name: Setup pyenv
run: |
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
INSTALLED=""
set +e
for v in 3.10 3.11 3.12 3.13 3.14; do
echo "=== Installing Python $v ==="
if pyenv install "$v:latest"; then
INSTALLED="$INSTALLED $v"
else
echo "Normal install failed, retrying without ensurepip..."
installed_ver=$(pyenv latest "$v" 2>/dev/null)
if [ -n "$installed_ver" ]; then pyenv uninstall -f "$installed_ver" 2>/dev/null; fi
PYTHON_CONFIGURE_OPTS="--without-ensurepip" pyenv install "$v:latest" || true
if pyenv versions --bare | grep -q "^$v\."; then
INSTALLED="$INSTALLED $v"
echo "Python $v binary installed (pip bootstrap deferred)"
else
echo "WARNING: Python $v install failed completely, skipping"
fi
fi
done
set -e
if [ -z "$INSTALLED" ]; then echo "No Python installed!"; exit 1; fi
pyenv global $INSTALLED
echo "Installed versions:"
pyenv versions
- name: Install dependencies for all Python versions
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
for version in 3.10 3.11 3.12 3.13 3.14; do
if ! pyenv versions --bare | grep -q "^$version"; then continue; fi
echo "Installing dependencies for Python $version"
pyenv shell $version
if ! python -m pip --version 2>/dev/null; then
echo "pip missing, bootstrapping..."
curl -sS https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
python /tmp/get-pip.py || python -m ensurepip --upgrade || true
fi
python -m pip install --upgrade pip
python -m pip install setuptools tox pandas pyarrow wheel pytest pytest-cov
pyenv shell --unset
done
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build wheel
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
pyenv shell 3.10
make wheel
- name: Show files
run: |
ls -lh dist
shell: bash
- name: Test DataStore on all Python versions with pandas 2.x and 3.x
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
for version in 3.10 3.11 3.12 3.13 3.14; do
if ! pyenv versions --bare | grep -q "^$version"; then
echo "Python $version not available, skipping"
continue
fi
# pandas 3.x requires Python >= 3.11
if [[ "$version" == "3.10" ]]; then
PANDAS_CONSTRAINTS=("pandas<3.0")
else
PANDAS_CONSTRAINTS=("pandas<3.0" "pandas>=3.0")
fi
for PANDAS_CONSTRAINT in "${PANDAS_CONSTRAINTS[@]}"; do
echo "=============================================="
echo "Testing DataStore on Python $version with $PANDAS_CONSTRAINT"
echo "=============================================="
pyenv shell $version
python -m pip install dist/*.whl --force-reinstall
python -m pip install pytest pytest-cov hypothesis "$PANDAS_CONSTRAINT"
echo "Installed pandas version:"
python -c "import pandas; print(pandas.__version__)"
echo "Running DataStore tests on Python $version with $PANDAS_CONSTRAINT ..."
cd datastore
python -m pytest tests/ -v --tb=short -x
cd ..
echo "=============================================="
echo "DataStore tests PASSED on Python $version with $PANDAS_CONSTRAINT"
echo "=============================================="
pyenv shell --unset
done
done
continue-on-error: false
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Build & Test macOS x86_64 on: workflow_dispatch: inputs: TAG_NAME: description: 'Release Version Tag' required: true release: types: [created] push: branches: - main paths-ignore: - '**/*.md' pull_request: types: [opened, synchronize, reopened, ready_for_review] branches: - main paths-ignore: - '**/*.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test_datastore: name: Test DataStore (macOS x86_64) runs-on: macos-15-intel if: ${{ !github.event.pull_request.draft }} timeout-minutes: 120 steps: - name: Check machine architecture run: | echo "=== Machine Architecture Information ===" echo "Machine type: $(uname -m)" echo "Architecture: $(arch)" echo "System info: $(uname -a)" - name: Setup pyenv run: | curl https://pyenv.run | bash export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" INSTALLED="" set +e for v in 3.10 3.11 3.12 3.13 3.14; do echo "=== Installing Python $v ===" if pyenv install "$v:latest"; then INSTALLED="$INSTALLED $v" else echo "Normal install failed, retrying without ensurepip..." installed_ver=$(pyenv latest "$v" 2>/dev/null) if [ -n "$installed_ver" ]; then pyenv uninstall -f "$installed_ver" 2>/dev/null; fi PYTHON_CONFIGURE_OPTS="--without-ensurepip" pyenv install "$v:latest" || true if pyenv versions --bare | grep -q "^$v\."; then INSTALLED="$INSTALLED $v" echo "Python $v binary installed (pip bootstrap deferred)" else echo "WARNING: Python $v install failed completely, skipping" fi fi done set -e if [ -z "$INSTALLED" ]; then echo "No Python installed!"; exit 1; fi pyenv global $INSTALLED echo "Installed versions:" pyenv versions - name: Install dependencies for all Python versions run: | export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" for version in 3.10 3.11 3.12 3.13 3.14; do if ! pyenv versions --bare | grep -q "^$version"; then continue; fi echo "Installing dependencies for Python $version" pyenv shell $version if ! python -m pip --version 2>/dev/null; then echo "pip missing, bootstrapping..." curl -sS https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py python /tmp/get-pip.py || python -m ensurepip --upgrade || true fi python -m pip install --upgrade pip python -m pip install setuptools tox pandas pyarrow wheel pytest pytest-cov pyenv shell --unset done - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Build wheel run: | export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" pyenv shell 3.10 make wheel - name: Show files run: | ls -lh dist shell: bash - name: Test DataStore on all Python versions with pandas 2.x and 3.x run: | export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" for version in 3.10 3.11 3.12 3.13 3.14; do if ! pyenv versions --bare | grep -q "^$version"; then echo "Python $version not available, skipping" continue fi # pandas 3.x requires Python >= 3.11 if [[ "$version" == "3.10" ]]; then PANDAS_CONSTRAINTS=("pandas<3.0") else PANDAS_CONSTRAINTS=("pandas<3.0" "pandas>=3.0") fi for PANDAS_CONSTRAINT in "${PANDAS_CONSTRAINTS[@]}"; do echo "==============================================" echo "Testing DataStore on Python $version with $PANDAS_CONSTRAINT" echo "==============================================" pyenv shell $version python -m pip install dist/*.whl --force-reinstall python -m pip install pytest pytest-cov hypothesis "$PANDAS_CONSTRAINT" echo "Installed pandas version:" python -c "import pandas; print(pandas.__version__)" echo "Running DataStore tests on Python $version with $PANDAS_CONSTRAINT ..." cd datastore python -m pytest tests/ -v --tb=short -x cd .. echo "==============================================" echo "DataStore tests PASSED on Python $version with $PANDAS_CONSTRAINT" echo "==============================================" pyenv shell --unset done done continue-on-error: false
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
- Network fetches
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.