Update snap.yml #6
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: Cross-Platform Build and Publish | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libopencv-dev libtbb-dev libomp-dev | |
| - name: Configure and Build Tests | |
| run: | | |
| mkdir build_test | |
| cd build_test | |
| cmake .. -DCMAKE_CXX_STANDARD=23 -DENABLE_CUDA=OFF | |
| make -j2 | |
| - name: Clean up Build Artifacts | |
| run: rm -rf build_test | |
| - name: Build Snap | |
| uses: snapcore/action-build@v1 | |
| id: build | |
| - name: Publish Snap | |
| uses: snapcore/action-publish@v1 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
| with: | |
| snap: ${{ steps.build.outputs.snap }} | |
| release: edge | |
| verify-macos: | |
| name: Verify Compilation (macOS/Clang) | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies (Homebrew) | |
| run: | | |
| brew update | |
| brew install cmake opencv tbb libomp | |
| - name: Configure CMake (macOS) | |
| run: | | |
| mkdir build_mac | |
| cd build_mac | |
| cmake .. \ | |
| -DCMAKE_CXX_STANDARD=23 \ | |
| -DENABLE_CUDA=OFF \ | |
| -DCMAKE_C_COMPILER=clang \ | |
| -DCMAKE_CXX_COMPILER=clang++ | |
| - name: Build (macOS) | |
| run: | | |
| cd build_mac | |
| make -j3 |