Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 195 additions & 43 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Decimo Unit Tests
name: CI
on:
pull_request:
workflow_dispatch:
Expand All @@ -7,66 +7,218 @@ permissions:
contents: read
pull-requests: read

jobs:
testing-decimo:
name: with ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: ["macos-latest"]
os: ["ubuntu-22.04"]
defaults:
run:
shell: bash

runs-on: ${{ matrix.os }}
timeout-minutes: 30
# Shared setup repeated per job (GitHub Actions has no job-level includes,
# so we keep each job self-contained for clarity and parallelism).

defaults:
run:
shell: bash
jobs:
# ── Test: BigDecimal ─────────────────────────────────────────────────────────
test-bigdecimal:
name: Test BigDecimal
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
DEBIAN_FRONTEND: noninteractive

steps:
- name: Checkout repo
uses: actions/checkout@v4
- 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
run: |
pixi run mojo package src/decimo && cp decimo.mojopkg tests/
pixi run mojo package src/tomlmojo && mv tomlmojo.mojopkg tests/
- name: Run tests
run: bash ./tests/test_bigdecimal.sh

# ── Test: BigInt ─────────────────────────────────────────────────────────────
test-bigint:
name: Test BigInt
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
DEBIAN_FRONTEND: noninteractive
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
run: |
curl -fsSL https://pixi.sh/install.sh | sh

- name: Add path
pixi run mojo package src/decimo && cp decimo.mojopkg tests/
pixi run mojo package src/tomlmojo && mv tomlmojo.mojopkg tests/
- name: Run tests
run: bash ./tests/test_bigint.sh

# ── Test: BigUint ────────────────────────────────────────────────────────────
test-biguint:
name: Test BigUint
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
DEBIAN_FRONTEND: noninteractive
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
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages
run: |
pixi run mojo package src/decimo && cp decimo.mojopkg tests/
pixi run mojo package src/tomlmojo && mv tomlmojo.mojopkg tests/
- name: Run tests
run: bash ./tests/test_biguint.sh

- name: Activate virtualenv
# ── Test: BigInt10 ───────────────────────────────────────────────────────────
test-bigint10:
name: Test BigInt10
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
python3 -m venv $HOME/venv/
. $HOME/venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages
run: |
pixi run mojo package src/decimo && cp decimo.mojopkg tests/
pixi run mojo package src/tomlmojo && mv tomlmojo.mojopkg tests/
- name: Run tests
run: bash ./tests/test_bigint10.sh

- name: Pixi install
# ── Test: Decimal128 ─────────────────────────────────────────────────────────
test-decimal128:
name: Test Decimal128
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
pixi install
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build packages
run: |
pixi run mojo package src/decimo && cp decimo.mojopkg tests/
pixi run mojo package src/tomlmojo && mv tomlmojo.mojopkg tests/
- name: Run tests
run: bash ./tests/test_decimal128.sh

- name: Build package
# ── Test: TomlMojo ───────────────────────────────────────────────────────────
test-tomlmojo:
name: Test TomlMojo
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
DEBIAN_FRONTEND: noninteractive
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
run: |
pixi run mojo package src/decimo
pixi run mojo package src/tomlmojo
cp decimo.mojopkg tests/
cp decimo.mojopkg benches/
mv tomlmojo.mojopkg tests/
pixi run mojo package src/decimo && cp decimo.mojopkg tests/
pixi run mojo package src/tomlmojo && mv tomlmojo.mojopkg tests/
- name: Run tests
run: bash ./tests/test_tomlmojo.sh

# ── Test: CLI ────────────────────────────────────────────────────────────────
test-cli:
name: Test CLI
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
DEBIAN_FRONTEND: noninteractive
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
run: pixi run buildcli
- name: Run tests
run: bash ./tests/test_cli.sh
Comment on lines +179 to +182
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow runs pixi run build, but pixi.toml no longer defines a build task (it defines buildcli). This step will fail at runtime unless build is reintroduced or the workflow is updated to call the new task name.

Copilot uses AI. Check for mistakes.

# ── Test: Python bindings ────────────────────────────────────────────────────
test-python:
name: Test Python bindings
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
bash ./tests/test_all.sh
bash ./tests/test_toml.sh
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: pixi install
run: pixi install
- name: Build & run Python tests
run: pixi run testpy

Comment on lines +201 to 203
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow runs pixi run pytest, but pixi.toml does not define a pytest task (it defines testpy). This job will fail unless the task name is aligned (either add a pytest task/alias or update the workflow to run the existing Python test task).

Copilot uses AI. Check for mistakes.
- name: Install pre-commit
# ── Format check ─────────────────────────────────────────────────────────────
format-check:
name: Format check
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- name: Install pixi
run: curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
pip install pre-commit
pre-commit install

- name: Run pre-commit
run: |
pixi install
pre-commit run --all-files
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ kgen.trace.json*
/test*.py
local
# CLI binary
/decimo
/decimo
# Python build artifacts
*.so
__pycache__/
*.pyc
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ repos:
name: mojo-format
entry: pixi run mojo format
language: system
files: '\.(mojo|🔥|py)$'
files: '\.(mojo|🔥)$'
stages: [pre-commit]

- id: ruff-format
name: ruff-format
entry: pixi run ruff format
language: system
files: '\.py$'
stages: [pre-commit]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2026 Yuhao Zhu
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the Apache-2.0 license appendix template (“How to apply…”). Editing the template text (e.g., replacing the bracketed copyright line) makes the LICENSE file diverge from the standard license text and can create ambiguity for downstream tooling. Keep the LICENSE text verbatim and put the project’s actual copyright notice in a NOTICE file and/or in source file headers.

Suggested change
Copyright 2026 Yuhao Zhu
Copyright [yyyy] [name of copyright owner]

Copilot uses AI. Check for mistakes.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading