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
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pre-commit:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.3.1

- uses: actions/setup-python@v5.6.0
with:
python-version: '3.12'

- uses: pre-commit/action@v3.0.1

lint:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.3.1

- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy

- name: Run clang-tidy
run: ./script/clang-tidy.sh

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.3.1

- name: Configure CMake
run: cmake -B build

- name: Build
run: cmake --build build
1 change: 1 addition & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Markdownlint configuration
default: true
MD013: false # Disable line length limit
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# microOggDemuxer

[![CI](https://github.com/esphome-libs/micro-ogg-demuxer/actions/workflows/ci.yml/badge.svg)](https://github.com/esphome-libs/micro-ogg-demuxer/actions/workflows/ci.yml)

A lightweight, platform-agnostic Ogg container demuxer for embedded systems and general use.

## Features
Expand Down
15 changes: 10 additions & 5 deletions script/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ if [ -z "$CLANG_TIDY" ]; then
exit 1
fi

# Check for compile_commands.json
# Ensure compile_commands.json exists
if [ ! -f "${BUILD_DIR}/compile_commands.json" ]; then
echo "Error: compile_commands.json not found in ${BUILD_DIR}"
echo "Run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .."
exit 1
echo "Generating compile_commands.json..."
cmake -B "$BUILD_DIR" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "$ROOT_DIR"
fi

SOURCES="${ROOT_DIR}/src/ogg_demuxer.cpp"
# Find all C++ source files
SOURCES=$(find "$ROOT_DIR/src" -name '*.cpp' -o -name '*.c' 2>/dev/null || true)

if [ -z "$SOURCES" ]; then
echo "No source files found"
exit 0
fi

# Parse arguments
FIX_FLAG=""
Expand Down