Skip to content

fix tests.yaml syntax error #13

fix tests.yaml syntax error

fix tests.yaml syntax error #13

Workflow file for this run

name: Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
Core:
name: ${{ matrix.os }} - ${{ matrix.config_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
config_name: [Widgets, QML]
include:
- config_name: "Widgets"
cmake_flags: "-DSIMPLE_MAP_VIEW_BUILD_TESTS=ON"
build_type: "Debug"
- config_name: "QML"
cmake_flags: "-DSIMPLE_MAP_VIEW_BUILD_QML=ON -DSIMPLE_MAP_VIEW_BUILD_TESTS=ON"
build_type: "Debug"
steps:
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Configure CMake
shell: bash
run: |
mkdir build
cd build
cmake .. ${{ matrix.cmake_flags }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: build
run: |
cmake --build . --config ${{ matrix.build_type }}
- name: Run (Linux)
if: runner.os == 'Linux'
working-directory: build
run: xvfb-run ctest --output-on-failure
- name: Run (Windows / macOS)
if: runner.os != 'Linux'
shell: bash
working-directory: build
run: ctest -C ${{ matrix.build_type }} --output-on-failure
Python:
name: Python ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
shell: bash
run: |
pip install --upgrade pip
pip install pytest pytest-qt PySide6 shiboken6
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
CLANG_LIB_FILE=$(find /usr/lib/llvm-* -name "libclang.so" 2>/dev/null | head -n 1)
CLANG_LIB_DIR=$(dirname "$CLANG_LIB_FILE")
echo "Detected Clang Lib Dir: $CLANG_LIB_DIR"
QT_LIB_DIR=$(qtpaths --query QT_INSTALL_LIBS)
echo "Detected Qt Lib Dir: $QT_LIB_DIR"
echo "CLANG_INSTALL_DIR=$CLANG_LIB_DIR" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$CLANG_LIB_DIR:$QT_LIB_DIR:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Install Clang & Set Environment (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
brew install llvm
LLVM_PREFIX=$(brew --prefix llvm)
CLANG_LIB_DIR="$LLVM_PREFIX/lib"
echo "Detected Clang Lib Dir: $CLANG_LIB_DIR"
QT_LIB_DIR=$(qtpaths --query QT_INSTALL_LIBS)
echo "Detected Qt Lib Dir: $QT_LIB_DIR"
echo "CLANG_INSTALL_DIR=$CLANG_LIB_DIR" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$CLANG_LIB_DIR:$QT_LIB_DIR:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
echo "$LLVM_PREFIX/bin" >> $GITHUB_PATH
- name: Install Bindings
shell: bash
env:
PYTHONIOENCODING: utf-8
run: pip install .
- name: Run (Linux)
if: runner.os == 'Linux'
run: xvfb-run pytest
- name: Run (Windows / macOS)
if: runner.os != 'Linux'
run: pytest