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

permissions:
contents: read

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

jobs:
abi-check:
name: ABI Compatibility
runs-on: ubuntu-24.04

steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson libdbus-1-dev abigail-tools

- name: Checkout base branch (PR)
if: github.event_name == 'pull_request'
uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}
path: base

- name: Checkout base commit (push)
if: github.event_name == 'push'
uses: actions/checkout@v6
with:
ref: ${{ github.event.before }}
path: base

- name: Build base
run: |
cd base
meson setup build -Dlibdbus=enabled
meson compile -C build

- name: Checkout current
uses: actions/checkout@v6
with:
path: current

- name: Build current
run: |
cd current
meson setup build -Dlibdbus=enabled
meson compile -C build

- name: Check ABI compatibility
run: |
abidiff --headers-dir1 base/src --headers-dir2 current/src \
base/build/src/libcxlmi.so current/build/src/libcxlmi.so \
--no-added-syms \
--drop-private-types || {
echo "::warning::ABI changes detected. Please review if this is intentional."
exit 0
}
108 changes: 108 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Analysis

permissions:
contents: read

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

jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson lcov gcovr libdbus-1-dev

- name: Configure with coverage
run: meson setup build -Db_coverage=true -Dlibdbus=enabled

- name: Build
run: meson compile -C build

- name: Run tests
run: meson test -C build

- name: Generate coverage report
run: |
gcovr --xml --output build/meson-logs/coverage.xml \
--root . \
--filter 'src/' \
--exclude 'tests/' \
--exclude 'examples/' \
build

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: build/meson-logs/coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

static-analysis:
name: Static Analysis
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson clang clang-tools libdbus-1-dev

- name: Run Clang Static Analyzer
run: |
# Exclude meson-private to avoid false positives from meson's test files
scan-build --status-bugs --exclude build/meson-private \
meson setup build -Dlibdbus=enabled
scan-build --status-bugs --exclude build/meson-private \
-o scan-results meson compile -C build 2>&1 || {
echo "=== Static Analysis Errors Found ==="
echo ""
for report in scan-results/*/report-*.html; do
if [ -f "$report" ]; then
echo "--- $report ---"
# Extract bug info from HTML report
grep -E "BUGDESC|BUGTYPE|BUGFILE|BUGLINE" "$report" | \
sed 's/<!-- //g; s/ -->//g'
echo ""
fi
done
exit 1
}

clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson clang clang-tidy libdbus-1-dev

- name: Configure
run: meson setup build -Dlibdbus=enabled
env:
CC: clang

- name: Run clang-tidy
run: |
# Generate compile_commands.json is automatic with meson
# Run clang-analyzer checks (security and correctness)
find src -name '*.c' -exec clang-tidy --quiet {} \
-p build \
--checks='-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling' \
--warnings-as-errors='*' \;
138 changes: 138 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Build

permissions:
contents: read

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

jobs:
build:
name: Build (${{ matrix.compiler }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# x86-64
- os: ubuntu-24.04
compiler: gcc
cc: gcc
- os: ubuntu-24.04
compiler: clang
cc: clang
- os: ubuntu-22.04
compiler: gcc
cc: gcc
# ARM64
- os: ubuntu-24.04-arm
compiler: gcc
cc: gcc
- os: ubuntu-24.04-arm
compiler: clang
cc: clang

steps:
- uses: actions/checkout@v6

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson libdbus-1-dev

- name: Configure
run: meson setup build -Dlibdbus=enabled --werror
env:
CC: ${{ matrix.cc }}

- name: Build
run: meson compile -C build

- name: Run mock tests
run: meson test -C build

build-options:
name: Options (${{ matrix.name }}, ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# x86-64 configurations
- name: minimal
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=disabled
- name: dbus-openbmc
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=enabled -Dmctpd=openbmc
- name: dbus-codeconstruct
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=enabled -Dmctpd=codeconstruct
- name: cxl2.0-compat
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=enabled -Dcxl2_0_mode=enabled
- name: cxl2.0-compat+dbus-openbmc
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=enabled -Dmctpd=openbmc -Dcxl2_0_mode=enabled
- name: cxl2.0-compat+dbus-codeconstruct
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=enabled -Dmctpd=codeconstruct -Dcxl2_0_mode=enabled
- name: cxl2.0-compat+minimal
arch: x86-64
os: ubuntu-24.04
configure: -Dlibdbus=disabled -Dcxl2_0_mode=enabled
# ARM64 configurations
- name: minimal
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=disabled
- name: dbus-openbmc
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=enabled -Dmctpd=openbmc
- name: dbus-codeconstruct
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=enabled -Dmctpd=codeconstruct
- name: cxl2.0-compat
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=enabled -Dcxl2_0_mode=enabled
- name: cxl2.0-compat+dbus-openbmc
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=enabled -Dmctpd=openbmc -Dcxl2_0_mode=enabled
- name: cxl2.0-compat+dbus-codeconstruct
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=enabled -Dmctpd=codeconstruct -Dcxl2_0_mode=enabled
- name: cxl2.0-compat+minimal
arch: arm64
os: ubuntu-24.04-arm
configure: -Dlibdbus=disabled -Dcxl2_0_mode=enabled

steps:
- uses: actions/checkout@v6

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson libdbus-1-dev

- name: Configure
run: meson setup build ${{ matrix.configure }} --werror

- name: Build
run: meson compile -C build

- name: Run mock tests
run: meson test -C build
26 changes: 26 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Spelling

permissions:
contents: read

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

jobs:
codespell:
name: Codespell
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6

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

- name: Run codespell
run: codespell src/ tests/ examples/
Loading
Loading