ENH: Add GitHub Actions CI and update Azure Pipelines configurations #3
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: ${{ matrix.config.name }} | |
| runs-on: ${{ matrix.config.os }} | |
| timeout-minutes: 360 # Added timeout | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { | |
| name: "Ubuntu Latest GCC", | |
| os: ubuntu-latest, | |
| cc: "gcc", | |
| cxx: "g++", | |
| parallel: "$(nproc)" | |
| } | |
| - { | |
| name: "macOS Latest Clang", | |
| os: macos-latest, | |
| cc: "clang", | |
| cxx: "clang++", | |
| parallel: "$(sysctl -n hw.ncpu)" | |
| } | |
| - { | |
| name: "Windows Latest MSVC", | |
| os: windows-latest, | |
| cc: "cl", | |
| cxx: "cl", | |
| parallel: "$env:NUMBER_OF_PROCESSORS" | |
| } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Dependencies (Ubuntu) | |
| if: matrix.config.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build | |
| - name: Install Dependencies (macOS) | |
| if: matrix.config.os == 'macos-latest' | |
| run: | | |
| brew install ninja | |
| - name: Install Dependencies (Windows) | |
| if: matrix.config.os == 'windows-latest' | |
| run: | | |
| choco install ninja | |
| - name: Configure CMake | |
| shell: bash | |
| run: | | |
| cmake -B build -G Ninja \ | |
| -DCMAKE_C_COMPILER=${{ matrix.config.cc }} \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DBUILD_TESTING=ON \ | |
| -DBUILD_SHARED_LIBS=ON \ | |
| ${{ matrix.config.os != 'windows-latest' && '-DCMAKE_CXX_FLAGS="-mtune=native -march=native"' || '' }} \ | |
| ${{ matrix.config.os != 'windows-latest' && '-DCMAKE_C_FLAGS="-mtune=native -march=native"' || '' }} \ | |
| -DBRAINSTools_BUILD_DICOM_SUPPORT:BOOL=ON \ | |
| -DUSE_BRAINSCreateLabelMapFromProbabilityMaps:BOOL=ON \ | |
| -DUSE_BRAINSMultiModeSegment:BOOL=ON \ | |
| -DUSE_BRAINSMultiSTAPLE:BOOL=ON \ | |
| -DUSE_BRAINSMush:BOOL=ON \ | |
| -DUSE_BRAINSPosteriorToContinuousClass:BOOL=ON \ | |
| -DUSE_DWIConvert:BOOL=ON | |
| - name: Build | |
| shell: bash | |
| run: cmake --build build --config Release --parallel ${{ matrix.config.parallel }} | |
| - name: Test | |
| working-directory: build | |
| shell: bash | |
| run: ctest --output-on-failure -C Release --timeout 300 | |
| - name: Upload Build Logs | |
| uses: actions/upload-artifact@v4 | |
| if: always() # Changed from failure() to always() | |
| with: | |
| name: build-logs-${{ matrix.config.name }} | |
| path: | | |
| build/CMakeFiles/CMakeOutput.log | |
| build/CMakeFiles/CMakeError.log | |
| build/Testing/Temporary/LastTest.log |