Fix cmake configure on windows #40
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 and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| compiler: [native, llvm] | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install CMake | |
| uses: lukka/get-cmake@latest | |
| - name: Use LLVM and Clang for Linux | |
| run: | | |
| echo "CC=clang-18" >> $GITHUB_ENV | |
| echo "CXX=clang++-18" >> $GITHUB_ENV | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.compiler != 'native' }} | |
| - name: Configure with Clang for Windows | |
| run: cmake -B build -DCPPSPEC_BUILD_TESTS=YES -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" | |
| if: ${{ matrix.os == 'windows-latest' && matrix.compiler == 'llvm' }} | |
| - name: Configure with default compiler | |
| run: cmake -B build -DCPPSPEC_BUILD_TESTS=YES | |
| if: ${{ matrix.compiler == 'native' || matrix.os != 'windows-latest' }} | |
| - name: Build | |
| run: cmake --build build --config Release | |
| - name: Test | |
| run: ctest --test-dir build --build-config Release |