image simulation #4263
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: Build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: ON | |
| CTEST_PARALLEL_LEVEL: 1 | |
| jobs: | |
| #################### | |
| # Linux | |
| #################### | |
| Linux: | |
| name: ${{ matrix.name }} (${{ matrix.config }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| config: [Debug, Release] | |
| include: | |
| - os: ubuntu-latest | |
| name: Linux | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.1.6 | |
| with: | |
| fetch-depth: 10 | |
| - name: Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -o Acquire::Retries=3 install ccache | |
| echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV" | |
| - name: Cache Build | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.CACHE_PATH }} | |
| key: ${{ runner.os }}-${{ matrix.config }}-cache-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.config }}-cache | |
| - name: Prepare ccache | |
| run: | | |
| # ccache --max-size=20.0G | |
| ccache -V && ccache --show-stats && ccache --zero-stats | |
| - name: Configure | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} | |
| - name: Build | |
| run: cd build; make -j2; ccache --show-stats | |
| - name: Tests | |
| run: cd build; ctest --verbose --output-on-failure | |
| #################### | |
| # MacOS | |
| #################### | |
| MacOS: | |
| name: ${{ matrix.os }} (${{ matrix.config }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, macos-14] | |
| config: [Debug, Release] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.1.6 | |
| with: | |
| fetch-depth: 10 | |
| - name: Dependencies | |
| run: | | |
| brew install ccache | |
| echo 'CACHE_PATH=~/Library/Caches/ccache' >> "$GITHUB_ENV" | |
| - name: Cache Build | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.CACHE_PATH }} | |
| key: ${{ matrix.os }}-${{ matrix.config }}-cache-${{ github.sha }} | |
| restore-keys: ${{ matrix.os }}-${{ matrix.config }}-cache | |
| - name: Prepare ccache | |
| run: | | |
| # ccache --max-size=20.0G | |
| ccache -V && ccache --show-stats && ccache --zero-stats | |
| - name: Configure | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} | |
| - name: Build | |
| run: cd build; make -j2; ccache --show-stats | |
| - name: Tests | |
| run: cd build; ctest --verbose --output-on-failure | |
| #################### | |
| # Windows | |
| #################### | |
| Windows: | |
| name: Windows (${{ matrix.config }}) | |
| runs-on: windows-2022 | |
| env: | |
| SCCACHE_IDLE_TIMEOUT: "12000" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: [Debug, Release] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.1.6 | |
| with: | |
| fetch-depth: 10 | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Dependencies | |
| run: | | |
| choco install -y sccache | |
| "SCCACHE_DIR=${env:LOCALAPPDATA}\Mozilla\sccache" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Cache build | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.SCCACHE_DIR }} | |
| key: ${{ runner.os }}-${{ matrix.config }}-cache-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.config }}-cache | |
| - name: Prepare sccache | |
| run: | | |
| sccache --max-size=1.0G | |
| sccache -V && sccache --show-stats && sccache --zero-stats | |
| - name: Configure | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64 | |
| cmake -G Ninja ^ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^ | |
| -DCMAKE_POLICY_DEFAULT_CMP0141=NEW ^ | |
| -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded ^ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} ^ | |
| -B build ^ | |
| -S . | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64 | |
| cmake --build build -j2 && sccache --show-stats | |
| - name: Tests | |
| run: | | |
| cd build | |
| ctest --verbose --output-on-failure |