another solution #5
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: testMacOS | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - '**' | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies (Homebrew) | |
| run: | | |
| brew update | |
| brew install cmake boost gtk+3 hdf5 libomp llvm | |
| - name: Add Homebrew to PATH | |
| run: echo "/opt/homebrew/bin" >> $GITHUB_PATH | |
| - name: Configure Homebrew clang (symlink for easier access) | |
| run: | | |
| brew unlink llvm && brew link llvm --force --overwrite | |
| - name: Configure CMake with Homebrew clang and OpenMP support | |
| env: | |
| LDFLAGS: "-L/opt/homebrew/opt/libomp/lib" | |
| CPPFLAGS: "-I/opt/homebrew/opt/libomp/include" | |
| CC: "/opt/homebrew/opt/llvm/bin/clang" | |
| CXX: "/opt/homebrew/opt/llvm/bin/clang++" | |
| PATH: "/opt/homebrew/opt/llvm/bin:$PATH" | |
| run: | | |
| cmake -B build \ | |
| -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | |
| -DRAYX_WERROR=ON \ | |
| -DRAYX_REQUIRE_CUDA=OFF \ | |
| -DCMAKE_C_COMPILER="$CC" \ | |
| -DCMAKE_CXX_COMPILER="$CXX" \ | |
| -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include" \ | |
| -DCMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/opt/libomp/lib -lomp" | |
| - name: Build | |
| run: | | |
| cmake --build build --config ${{env.BUILD_TYPE}} | |
| - name: Run | |
| working-directory: ${{github.workspace}} | |
| run: | | |
| ./build/bin/release/rayx -x -c -m 1 -i Intern/rayx-core/tests/input/BoringImagePlane.rml | |
| ./build/bin/release/rayx -x -m 1 -i Intern/rayx-core/tests/input/BoringImagePlane.rml | |
| git checkout -- Intern/rayx-core/tests/input/BoringImagePlane.csv | |
| - name: Test | |
| working-directory: ${{github.workspace}}/build/bin/release | |
| run: ./rayx-core-tst -x | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: RAYX-macOS-${{env.BUILD_TYPE}} | |
| path: ${{github.workspace}}/build/bin/release |