Skip to content

Python only unit tests #168

Python only unit tests

Python only unit tests #168

Workflow file for this run

name: demo/shared-test
on:
push:
branches: [ main ]
paths:
- 'Makefile'
- 'include/**'
- '*.cpp'
- '*.hpp'
- 'demo/shared-test.cpp'
- '.github/workflows/shared-test.yml'
pull_request:
branches:
- main
- '**'
jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run make
shell: pwsh
run: |
$env:PREFIX = 'C:\Program Files\Sista'
make install
- name: Find dynamic library
if: runner.os == 'Windows'
id: find_dynamic_lib_win
shell: pwsh
run: |
$dll = Get-ChildItem -Path "C:\Program Files\Sista\lib" -Filter "libSista.dll" -Recurse | Select-Object -First 1
echo "DYNAMIC_LIB=$($dll.FullName)" >> $env:GITHUB_ENV
- name: Find static library
if: runner.os == 'Windows'
id: find_static_lib_win
shell: pwsh
run: |
$lib = Get-ChildItem -Path "C:\Program Files\Sista\lib" -Filter "libSista.a" -Recurse | Select-Object -First 1
echo "STATIC_LIB=$($lib.FullName)" >> $env:GITHUB_ENV
- name: Display libraries
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Dynamic Library: $env:DYNAMIC_LIB"
Write-Host "Static Library: $env:STATIC_LIB"
- name: Compile tests
run: |
cd demo
make shared-test
make shared-test-static
- name: Display test results
run: |
cd demo
echo "Running shared-test.exe"
.\shared-test.exe
echo "Running shared-test-static.exe"
.\shared-test-static.exe
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: shared-test-windows
path: |
demo/shared-test.exe
demo/shared-test-static.exe
macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tags
- name: Run make
run: sudo PREFIX=/usr/local make install
- name: Find dynamic library
id: find_dynamic_lib_mac
run: |
echo "DYNAMIC_LIB=$(find /usr/local/lib -name 'libSista.so' -o -name 'libSista.dylib' -print -quit)" >> $GITHUB_ENV
- name: Find static library
id: find_static_lib_mac
run: |
echo "STATIC_LIB=$(find /usr/local/lib -name 'libSista.a' -print -quit)" >> $GITHUB_ENV
- name: Display libraries
run: |
echo "Dynamic Library: $DYNAMIC_LIB"
echo "Static Library: $STATIC_LIB"
- name: Compile tests
run: |
cd demo
make shared-test
- name: Display test results
run: |
cd demo
echo "Running shared-test"
./shared-test
- name: Upload test results
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: shared-test-macos
path: |
demo/shared-test
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tags
- name: Run make
run: sudo PREFIX=/usr/local make install
- name: Find dynamic library
id: find_dynamic_lib_linux
run: |
echo "DYNAMIC_LIB=$(find /usr/local/lib -name 'libSista.so' -print -quit)" >> $GITHUB_ENV
- name: Find static library
id: find_static_lib_linux
run: |
echo "STATIC_LIB=$(find /usr/local/lib -name 'libSista.a' -print -quit)" >> $GITHUB_ENV
- name: Display libraries
run: |
echo "Dynamic Library: $DYNAMIC_LIB"
echo "Static Library: $STATIC_LIB"
- name: Compile tests
run: |
cd demo
make shared-test
make shared-test-static
- name: Display test results
run: |
cd demo
echo "Running shared-test"
./shared-test
echo "Running shared-test-static"
./shared-test-static
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: shared-test-linux
path: |
demo/shared-test
demo/shared-test-static