Small fixes as we go 1 (#7) #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test MnxValidate | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
generator: Ninja | |
- os: macos-latest | |
generator: Ninja | |
- os: windows-latest | |
generator: "Visual Studio 17 2022" | |
steps: | |
# Checkout the repository with submodules | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Clone submodules recursively | |
fetch-depth: 0 # Ensure full history for submodules | |
# Display Preinstalled Tools | |
- name: Display preinstalled tools | |
run: | | |
cmake --version | |
# Install Ninja (if needed) | |
- name: Install Ninja on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update && sudo apt-get install -y ninja-build | |
- name: Install Ninja on macOS | |
if: matrix.os == 'macos-latest' | |
run: brew install ninja || echo "Ninja already installed" | |
- name: Verify Ninja Installation | |
if: matrix.os != 'windows-latest' | |
run: ninja --version || echo "Ninja is not available on this platform" | |
# Configure on Linux and macOS | |
- name: Configure with CMake on Linux and macOS | |
if: matrix.os != 'windows-latest' | |
run: cmake -G "${{ matrix.generator }}" -S . -B build -DCMAKE_BUILD_TYPE=Release | |
# Configure on Windows | |
- name: Configure with CMake on Windows | |
if: matrix.os == 'windows-latest' | |
run: cmake -G "${{ matrix.generator }}" -S . -B build | |
# Build on Linux and macOS | |
- name: Build on Linux and macOS | |
if: matrix.os != 'windows-latest' | |
run: cmake --build build | |
# Build on Windows | |
- name: Build on Windows | |
if: matrix.os == 'windows-latest' | |
run: cmake --build build --config Release | |
- name: Run Tests on Windows | |
if: runner.os == 'Windows' | |
run: ctest --test-dir build/tests -C Release --output-on-failure | |
- name: Run Tests on Linux/macOS | |
if: runner.os != 'Windows' | |
run: ctest --test-dir build/tests --output-on-failure | |