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
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## What changed

Describe the change and the problem it solves.

## Verification

Describe the build, tests and any controlled benchmarks you ran.

## Checklist

- [ ] The change is focused and does not include unrelated churn.
- [ ] The registered CTest suite passes locally.
- [ ] Public API or behaviour changes are documented.
- [ ] New code respects the licensing boundary documented in `LICENSING.md`.
- [ ] Performance claims, if any, include hardware, compiler and build configuration.
151 changes: 67 additions & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,56 @@
name: CI

on:
# Fast check on PRs — build + unit tests only (no benchmarks)
pull_request:
branches: [ main ]

# Same check on main, so the branch keeps a current status. Without this
# the README and profile badges stay frozen on whatever ran last.
branches: [main]
push:
branches: [ main ]
branches: [main]
tags: ['v*']
workflow_dispatch:

permissions:
contents: read

# Release builds: triggered by version tags (v1.0.0, v2.3.1, etc.)
tags:
- 'v*'
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# ---------------------------------------------------------------
# Quick CI gate — runs on every PR to main and every push to main
# Builds the library and runs only fast unit tests (<2 min total).
# Benchmarks and long-running tests are SKIPPED here because
# GitHub's free runners are too slow / unreliable for them.
# See TESTING.md for the full rationale.
# ---------------------------------------------------------------
build-and-test:
name: ${{ matrix.compiler }} / Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: GCC
cc: gcc
cxx: g++
- compiler: Clang
cc: clang
cxx: clang++
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up C++ environment
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake g++ libgtest-dev

- name: Build and install Google Test
run: |
cd /usr/src/gtest
sudo cmake .
sudo make
sudo cp lib/*.a /usr/lib

- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

- name: Build the project
run: cmake --build build -j$(nproc)

- name: Run unit tests (benchmarks excluded)
run: |
cd build
ctest --output-on-failure --timeout 120
echo "See TESTING.md for info on skipped/disabled tests"

# ---------------------------------------------------------------
# Release job — only runs when a version tag is pushed.
# Builds an optimised binary and uploads it as a GitHub Release.
# ---------------------------------------------------------------
- name: Checkout
uses: actions/checkout@v4

- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build

- name: Configure
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build --parallel 2

- name: Test
run: ctest --test-dir build --output-on-failure --timeout 120

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build-and-test
Expand All @@ -65,40 +59,29 @@ jobs:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up C++ environment
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake g++ libgtest-dev

- name: Build and install Google Test
run: |
cd /usr/src/gtest
sudo cmake .
sudo make
sudo cp lib/*.a /usr/lib

- name: Build release binaries
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

- name: Package binaries
run: |
mkdir -p release
# Copy library
cp build/libTinyML.a release/
# Copy test/benchmark executables (if they exist)
find build/bin -type f -executable -exec cp {} release/ \; 2>/dev/null || true
find build -maxdepth 1 -type f -executable -exec cp {} release/ \; 2>/dev/null || true
# Create tarball
tar -czf tinyml-${{ github.ref_name }}-linux-x86_64.tar.gz -C release .
ls -lh tinyml-${{ github.ref_name }}-linux-x86_64.tar.gz

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: tinyml-${{ github.ref_name }}-linux-x86_64.tar.gz
generate_release_notes: true
- name: Checkout
uses: actions/checkout@v4

- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build

- name: Configure
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build --parallel 2

- name: Package
run: |
mkdir -p release
cp build/libTinyML.a release/
find build/bin -type f -executable -exec cp {} release/ \; 2>/dev/null || true
tar -czf tinyml-${{ github.ref_name }}-linux-x86_64.tar.gz -C release .

- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
files: tinyml-${{ github.ref_name }}-linux-x86_64.tar.gz
generate_release_notes: true
40 changes: 40 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Pages

on:
push:
branches: [main]
paths:
- 'site/**'
- '.github/workflows/pages.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Pages
uses: actions/configure-pages@v5

- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributing to TinyML

Thanks for improving TinyML. Changes should be narrowly scoped, reproducible and accompanied by the smallest useful test coverage.

## Before opening a pull request

Build and run the registered test suite:

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure
```

If a change affects wall-clock performance, benchmark it on controlled hardware and include the hardware, compiler, build type and command used. Do not use shared GitHub-hosted runners as benchmark evidence.

Keep public API changes documented. New algorithms should include a focused example or test showing the intended behaviour. Avoid unrelated formatting or generated-file churn in functional pull requests.

## Pull requests

Describe the problem, the approach, how it was verified and any compatibility or licensing implications. CI must pass before merge.

## Licensing

Read `LICENSING.md` before adding new public headers or dependencies. Contributions must preserve the documented boundary between the MIT core and the separately licensed extended model library.
Loading
Loading