Skip to content

[error] Use shortened and relative paths for files that raise errors in error messages to ensure privacy at compilation #304

[error] Use shortened and relative paths for files that raise errors in error messages to ensure privacy at compilation

[error] Use shortened and relative paths for files that raise errors in error messages to ensure privacy at compilation #304

Workflow file for this run

name: Decimo Unit Tests
on:
push:
branches: [main, dev]
pull_request:
workflow_dispatch:
permissions:
contents: read
pull-requests: read
defaults:
run:
shell: bash
# Shared setup repeated per job (GitHub Actions has no job-level includes,
# so we keep each job self-contained for clarity and parallelism).
jobs:
# ── Test: BigDecimal ─────────────────────────────────────────────────────────
test-bigdecimal:
name: Test BigDecimal
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_bigdecimal.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: BigInt ─────────────────────────────────────────────────────────────
test-bigint:
name: Test BigInt
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_bigint.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: BigUint ────────────────────────────────────────────────────────────
test-biguint:
name: Test BigUint
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_biguint.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: BigInt10 ───────────────────────────────────────────────────────────
test-bigint10:
name: Test BigInt10
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_bigint10.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: Decimal128 ─────────────────────────────────────────────────────────
test-decimal128:
name: Test Decimal128
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_decimal128.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: BigFloat ─────────────────────────────────────────────────────────
test-bigfloat:
name: Test BigFloat
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Install MPFR
run: brew install mpfr
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_bigfloat.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: TOML parser ─────────────────────────────────────────────────────
test-toml:
name: Test TOML parser
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run mojo package src/decimo && cp decimo.mojopkg tests/; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_toml.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: CLI ────────────────────────────────────────────────────────────────
test-cli:
name: Test CLI
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build CLI binary (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== build attempt $attempt ==="
if pixi run buildcli; then
echo "=== build succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== build failed after 3 attempts ==="
exit 1
fi
echo "=== build crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if bash ./tests/test_cli.sh; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Test: Python bindings ────────────────────────────────────────────────────
test-python:
name: Test Python bindings
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build & run Python tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if pixi run testpy; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done
# ── Doc generation check ──────────────────────────────────────────────────────
doc-check:
name: Doc generation
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Generate docs (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== doc attempt $attempt ==="
if pixi run doc; then
echo "=== doc succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== doc failed after 3 attempts ==="
exit 1
fi
echo "=== doc crashed, retrying in 5s... ==="
sleep 5
done
# ── Format check ─────────────────────────────────────────────────────────────
format-check:
name: Format check
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Install pre-commit
run: pip install pre-commit
- name: Run format check
run: pre-commit run --all-files