Skip to content

docs: update README with unit test instructions and add test suite fo… #41

docs: update README with unit test instructions and add test suite fo…

docs: update README with unit test instructions and add test suite fo… #41

Workflow file for this run

name: CI
on:
push:
branches: [ '**']
tags: [ 'v*' ]
pull_request:
branches: [ master ]
permissions:
contents: write
actions: write
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake libeigen3-dev libgtest-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install --formula cmake eigen googletest
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DLIBGP_BUILD_TESTS=ON
- name: Build
run: cmake --build build
- name: Test
run: cmake --build build --target test
- name: Create Package
run: |
# Install to staging directory
cmake --install build --prefix stage/usr
# Debug: List contents of stage directory
ls -R stage/
# Package name with version and OS
VERSION=$(grep 'VERSION' CMakeLists.txt | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
OS_SUFFIX=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
PACKAGE_NAME="libgp-${VERSION}-${OS_SUFFIX}"
# Create distribution package
mkdir -p "dist/${PACKAGE_NAME}"
cp -r stage/usr/* "dist/${PACKAGE_NAME}/"
cd dist
tar czf "${PACKAGE_NAME}.tar.gz" "${PACKAGE_NAME}"
# Debug: Show created files
ls -l *.tar.gz
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: libgp-dist-${{ runner.os }}
path: dist/*.tar.gz
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: dist/*.tar.gz
generate_release_notes: true