Merge pull request #399 from tudo-astroparticlephysics/Jean1995-patch-1 #763
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: Check c++ pkg PROPOSAL. | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os : "ubuntu-latest" | |
| compiler : "gcc" | |
| compilerpp : "g++" | |
| - os : "macos-latest" | |
| compiler : "clang" | |
| compilerpp : "clang++" | |
| - os : "windows-latest" | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| CXX: ${{ matrix.compilerpp }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Conan | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| id: cache-conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan | |
| key: ${{ runner.os }}-cache-conan-${{ matrix.compiler }}-${{ hashFiles('conanfile.py') }}-key | |
| - name: Cache build | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: ${{ runner.os }}-cache-build-${{ matrix.compiler }}-${{ github.sha }}-key | |
| - name: Cache tests | |
| id: cache-tests | |
| uses: actions/cache@v4 | |
| with: | |
| path: tests | |
| key: ${{ runner.os }}-cache-tests-${{ matrix.compiler }}-${{ github.sha }}-key | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.8' | |
| - name: Install python dependencies | |
| run: python -m pip install conan | |
| - name: Initialize conan | |
| run: conan profile detect | |
| - name: Prepare dependencies using conan | |
| run: conan install . --build=missing -o with_testing=True | |
| - name: Call CMake | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| run: cmake . -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake | |
| - name: Call CMake (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: cmake . -DCMAKE_TOOLCHAIN_FILE="build/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW | |
| - name: Build PROPOSAL | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| run: cmake --build . -j2 | |
| - name: Build PROPOSAL (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: cmake --build . -j2 --config Release | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| needs: build | |
| strategy: | |
| matrix: | |
| include: | |
| - os : "ubuntu-latest" | |
| compiler : "gcc" | |
| compilerpp : "g++" | |
| - os : "macos-latest" | |
| compiler : "clang" | |
| compilerpp : "clang++" | |
| - os : "windows-latest" | |
| env: | |
| PROPOSAL_TEST_FILES: ${{ github.workspace }}/tests/TestFiles | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache conan | |
| if: ${{ matrix.os != 'windows-latest' }} | |
| id: cache-conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan | |
| key: ${{ runner.os }}-cache-conan-${{ matrix.compiler }}-${{ hashFiles('conanfile.py') }}-key | |
| - name: Cache tests | |
| id: cache-tests | |
| uses: actions/cache@v4 | |
| with: | |
| path: tests | |
| key: ${{ runner.os }}-cache-tests-${{ matrix.compiler }}-${{ github.sha }}-key | |
| - name: Run tests | |
| run: ctest --test-dir tests -j2 --verbose -E "(Brems.*Interpolant|Photo.*Interpolant|Epair.*Interpolant|Mupair.*Interpolant)" |