|
name: Run Unit Tests |
|
|
|
on: |
|
push: |
|
branches: [ main ] |
|
pull_request: |
|
branches: [ main ] |
|
|
|
concurrency: |
|
group: ${{ github.head_ref || github.run_id }} |
|
cancel-in-progress: true |
|
|
|
jobs: |
|
run_ruff: |
|
uses: ./.github/workflows/run_ruff.yml |
|
|
|
test: |
|
needs: [run_ruff] |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
platform: [windows-latest, ubuntu-latest, macos-15-intel, macos-latest] |
|
version: ["3.10", "3.13"] |
|
defaults: |
|
run: |
|
shell: bash -l {0} |
|
|
|
runs-on: ${{ matrix.platform}} |
|
|
|
steps: |
|
- uses: actions/checkout@v5 |
|
with: |
|
submodules: true |
|
- name: Set up Python version ${{ matrix.version }} |
|
uses: actions/setup-python@v6 |
|
with: |
|
python-version: ${{ matrix.version }} |
|
- name: Install OMP (MacOS Intel) |
|
if: matrix.platform == 'macos-15-intel' |
|
run: | |
|
brew install llvm@20 libomp |
|
echo "export CC=/usr/local/opt/llvm@20/bin/clang" >> ~/.bashrc |
|
echo "export CXX=/usr/local/opt/llvm@20/bin/clang++" >> ~/.bashrc |
|
echo "export CFLAGS=\"$CFLAGS -I/usr/local/opt/libomp/include\"" >> ~/.bashrc |
|
echo "export CXXFLAGS=\"$CXXFLAGS -I/usr/local/opt/libomp/include\"" >> ~/.bashrc |
|
echo "export LDFLAGS=\"$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp\"" >> ~/.bashrc |
|
source ~/.bashrc |
|
- name: Install OMP (MacOS M1) |
|
if: matrix.platform == 'macos-latest' |
|
run: | |
|
brew install llvm@20 libomp |
|
echo "export CC=/opt/homebrew/opt/llvm@20/bin/clang" >> ~/.bashrc |
|
echo "export CXX=/opt/homebrew/opt/llvm@20/bin/clang++" >> ~/.bashrc |
|
echo "export CFLAGS=\"$CFLAGS -I/opt/homebrew/opt/libomp/include\"" >> ~/.bashrc |
|
echo "export CXXFLAGS=\"$CXXFLAGS -I/opt/homebrew/opt/libomp/include\"" >> ~/.bashrc |
|
echo "export LDFLAGS=\"$LDFLAGS -Wl,-rpath,/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp\"" >> ~/.bashrc |
|
source ~/.bashrc |
|
- name: Install OMP (Linux) |
|
if: runner.os == 'Linux' |
|
run: | |
|
sudo apt-get update |
|
sudo apt install libomp-dev |
|
- name: Install and Test with pytest |
|
run: | |
|
export PATH="$pythonLocation:$PATH" |
|
python -m pip install -e .[dev,orso] |
|
pytest tests/ --cov=ratapi --cov-report=term |