Enhance Windows configuration in build-check.yml to correctly set R_H… #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: Build Check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libreadline-dev \ | |
| libncurses-dev | |
| - name: Install macOS dependencies | |
| if: runner.os == 'macOS' | |
| env: | |
| HOMEBREW_NO_AUTO_UPDATE: 1 | |
| run: | | |
| brew install readline ncurses | |
| - name: Set up MSVC | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Configure Unix | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/install" \ | |
| -DR_HOME="$(R RHOME)" | |
| - name: Configure Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $rhome = (R.exe RHOME) | Out-String | |
| $rhome = $rHome.Trim() | |
| $env:R_HOME = $rhome | |
| cmake -S . -B build ` | |
| -G "Visual Studio 17 2022" ` | |
| -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/install" ` | |
| -DR_HOME="$rhome" | |
| - name: Build | |
| run: cmake --build build --config Release --parallel |