Skip to content

Add Windows MPU arena backing and CI coverage. #35

Add Windows MPU arena backing and CI coverage.

Add Windows MPU arena backing and CI coverage. #35

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
defaults:
run:
shell: bash
jobs:
mcu-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install Clang 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Export LLVM compiler paths
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
echo "CC=${{ github.workspace }}/llvm/bin/clang" >> "$GITHUB_ENV"
echo "CXX=${{ github.workspace }}/llvm/bin/clang++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Build and test (MCU Clang)
run: make all check-lib
- name: Freestanding MCU C library (no libstdc++ link)
run: make lib-mcu-c check-lib-mcu-c test-lib-mcu-c-link
mcu-gcc-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install GCC 14
run: sudo apt-get update && sudo apt-get install -y g++-14 gcc-14
- name: Build and test (MCU GCC)
run: |
make clean
make all check-lib \
CC=gcc-14 \
CXX=g++-14 \
CXXFLAGS="-std=c++23 -Wall -Wextra -Wpedantic -Iinclude -DMEMKIT_MCU=1 -fno-exceptions -fno-rtti" \
CFLAGS="-std=c23 -Wall -Wextra -Wpedantic -Iinclude -DMEMKIT_MCU=1"
make lib-mcu-c check-lib-mcu-c test-lib-mcu-c-link \
CC=gcc-14 \
CXX=g++-14 \
CXXFLAGS="-std=c++23 -Wall -Wextra -Wpedantic -Iinclude -DMEMKIT_MCU=1 -fno-exceptions -fno-rtti" \
CFLAGS="-std=c23 -Wall -Wextra -Wpedantic -Iinclude -DMEMKIT_MCU=1"
mpu-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install Clang 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Export LLVM compiler paths
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
echo "CC=${{ github.workspace }}/llvm/bin/clang" >> "$GITHUB_ENV"
echo "CXX=${{ github.workspace }}/llvm/bin/clang++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Build and test (MPU)
run: make mpu
mpu-asan-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install Clang 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Export LLVM compiler paths
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
echo "CC=${{ github.workspace }}/llvm/bin/clang" >> "$GITHUB_ENV"
echo "CXX=${{ github.workspace }}/llvm/bin/clang++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Build and test (MPU + ASan/UBSan)
run: |
make clean
make mpu \
CXXFLAGS="-std=c++26 -Wall -Wextra -Wpedantic -Iinclude -DMEMKIT_MPU=1 -DEMBEDDED_LINUX=1 -DMEMKIT_ALLOW_HEAP=1 -DMEMKIT_ALLOW_MMAP=1 -fno-exceptions -fno-rtti -fsanitize=address,undefined -fno-omit-frame-pointer" \
CFLAGS="-std=c23 -Wall -Wextra -Wpedantic -Iinclude -DMEMKIT_MPU=1 -DEMBEDDED_LINUX=1 -DMEMKIT_ALLOW_HEAP=1 -DMEMKIT_ALLOW_MMAP=1 -fsanitize=address,undefined -fno-omit-frame-pointer" \
LDFLAGS="-fsanitize=address,undefined"
cmake-mcu-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install Clang 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Export LLVM compiler paths
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
echo "CC=${{ github.workspace }}/llvm/bin/clang" >> "$GITHUB_ENV"
echo "CXX=${{ github.workspace }}/llvm/bin/clang++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Configure (MCU)
run: cmake -B build-mcu -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_C_COMPILER="$CC"
- name: Build
run: cmake --build build-mcu
- name: Test
run: ctest --test-dir build-mcu --output-on-failure
cmake-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install Clang 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Export LLVM compiler paths
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
echo "CC=${{ github.workspace }}/llvm/bin/clang" >> "$GITHUB_ENV"
echo "CXX=${{ github.workspace }}/llvm/bin/clang++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Configure (MPU)
run: cmake -B build -DMEMKIT_EMBEDDED_LINUX=ON -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_C_COMPILER="$CC"
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
mpu-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install LLVM 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Configure (MPU, Clang)
shell: bash
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
cmake -B build-mpu -G Ninja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DMEMKIT_MPU=ON \
-DMEMKIT_ALLOW_MMAP=ON
- name: Build
run: cmake --build build-mpu
- name: Test
run: ctest --test-dir build-mpu -C Debug --output-on-failure
mpu-windows-msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Configure (MPU, MSVC)
run: cmake -B build-msvc -DMEMKIT_MPU=ON -DMEMKIT_ALLOW_MMAP=ON
- name: Build
run: cmake --build build-msvc --config Release
- name: Test
run: ctest --test-dir build-msvc -C Release --output-on-failure
benchmark-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache LLVM 21
uses: actions/cache@v4
id: cache-llvm
with:
path: llvm
key: llvm-21-${{ runner.os }}-v1
- name: Install Clang 21 (C++26)
if: steps.cache-llvm.outputs.cache-hit != 'true'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
directory: ${{ github.workspace }}/llvm
- name: Export LLVM compiler paths
run: |
echo "${{ github.workspace }}/llvm/bin" >> "$GITHUB_PATH"
echo "CC=${{ github.workspace }}/llvm/bin/clang" >> "$GITHUB_ENV"
echo "CXX=${{ github.workspace }}/llvm/bin/clang++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
- name: Run benchmarks
run: |
make benchmark BENCH_ITERS=50000
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build and test (MCU + MPU)
run: |
make all
make mpu
- name: Run benchmarks
run: make benchmark BENCH_ITERS=50000