| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- name: Build
- on:
- push:
- branches:
- - main
- - stable
- pull_request:
- branches:
- - main
- - stable
- env:
- CTEST_OUTPUT_ON_FAILURE: ON
- CTEST_PARALLEL_LEVEL: 2
- jobs:
- ####################
- # Linux / macOS
- ####################
- Unix:
- name: ${{ matrix.os }} ${{ fromJSON('["Header-Only", "Static"]')[matrix.build-params.static == 'ON'] }} ${{ matrix.build-params.tutorials == 'ON' && 'tutorial' || ''}} ${{ matrix.build-params.tests == 'ON' && 'tests' || ''}} ${{ matrix.config }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-24.04, macos-latest]
- config: [Release]
- build-params: [ {static: ON, tutorials: ON, tests: ON }, {static: OFF, tutorials: OFF, tests: ON }, {static: OFF, tutorials: ON, tests: OFF }]
- env:
- IGL_NUM_THREADS: 4 # don't go wild, but let the parallel_for tests do something
- steps:
- - name: Checkout repository
- uses: actions/checkout@v1
- with:
- fetch-depth: 10
- - name: Dependencies (Linux)
- if: runner.os == 'Linux'
- run: |
- sudo apt-get update
- sudo apt-get install \
- libblas-dev \
- libglu1-mesa-dev \
- liblapack-dev \
- xorg-dev \
- ccache
- - name: Dependencies (macOS)
- if: runner.os == 'macOS'
- run: |
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- - name: Setup Xcode version
- if: runner.os == 'macOS'
- uses: maxim-lobanov/setup-xcode@v1
- with:
- xcode-version: '16.3.0'
- - name: Cache Build
- id: cache-build
- uses: actions/cache@v4
- with:
- path: ~/.ccache
- key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.build-params.static }}-cache
- - name: Prepare ccache
- run: |
- ccache --max-size=1.0G
- ccache -V && ccache --show-stats && ccache --zero-stats
- - name: Configure
- run: |
- mkdir -p build
- cd build
- # https://github.com/eclipse-ecal/ecal/issues/2041
- cmake .. \
- -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
- -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
- -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.build-params.static }} \
- -DLIBIGL_BUILD_TUTORIALS=${{ matrix.build-params.tutorials }} \
- -DLIBIGL_GLFW_TESTS=OFF \
- -DLIBIGL_BUILD_TESTS=${{ matrix.build-params.tests }} \
- -DLIBIGL_COPYLEFT_CGAL=ON
- - name: Build
- run: cd build; make -j2; ccache --show-stats
- - name: Tests
- run: cd build; ctest --show-only; ctest --verbose
- ####################
- # Windows
- ####################
- Windows:
- name: Windows ${{ fromJSON('["Header-Only", "Static"]')[matrix.build-params.static == 'ON'] }} ${{ matrix.build-params.tutorials == 'ON' && 'tutorial' || ''}} ${{ matrix.build-params.selected_tutorial != 'NONE' && matrix.build-params.selected_tutorial || '' }} ${{ matrix.build-params.tests == 'ON' && 'tests' || ''}} ${{ matrix.config }}
- runs-on: windows-2022
- strategy:
- fail-fast: false
- matrix:
- config: [Release]
- build-params: [
- {static: ON, tutorials: ON, tests: ON, selected_tutorial: NONE},
- {static: OFF, tutorials: OFF, tests: ON, selected_tutorial: NONE},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 1},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 2},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 3},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 4},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 5},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 6},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 7},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 8},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 9},
- {static: OFF, tutorials: ON, tests: OFF, selected_tutorial: 10},
- ]
- steps:
- - name: Checkout repository
- uses: actions/checkout@v1
- with:
- fetch-depth: 10
- - name: Install Ninja
- uses: seanmiddleditch/gha-setup-ninja@master
- - name: Set env variable for sccache
- run: |
- echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV}
- - name: Cache build
- id: cache-build
- uses: actions/cache@v4
- with:
- path: ${{ env.appdata }}\Mozilla\sccache
- key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.build-params.static }}-cache
- - name: Prepare sccache
- run: |
- iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1'
- .\install.ps1 -RunAsAdmin
- scoop install sccache --global
- # Scoop modifies the PATH so we make it available for the next steps of the job
- echo "${env:PATH}" >> ${env:GITHUB_PATH}
- - name: Configure and build
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
- # https://github.com/eclipse-ecal/ecal/issues/2041
- cmake -G Ninja ^
- -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^
- -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
- -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
- -DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.build-params.static }} ^
- -DLIBIGL_COPYLEFT_CGAL=ON ^
- -DLIBIGL_BUILD_TUTORIALS=${{ matrix.build-params.tutorials }} ^
- -DLIBIGL_BUILD_TESTS=${{ matrix.build-params.tests }} ^
- -DLIBIGL_GLFW_TESTS=OFF ^
- -DLIBIGL_TUTORIALS_CHAPTER1=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '1') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER2=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '2') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER3=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '3') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER4=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '4') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER5=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '5') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER6=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '6') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER7=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '7') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER8=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '8') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER9=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '9') && 'ON' || 'OFF' }} ^
- -DLIBIGL_TUTORIALS_CHAPTER10=${{ (matrix.build-params.selected_tutorial == 'NONE' || matrix.build-params.selected_tutorial == '10') && 'ON' || 'OFF' }} ^
- -B build ^
- -S .
- cmake --build build -j2
- - name: Tests
- run: cd build; ctest --show-only; ctest --verbose -j2
|