GitHub Actions CI MSYS2 with MS-MPI on Windows
This file contains 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: CI CMake | |
env: | |
CMAKE_BUILD_TYPE: Release | |
CMAKE_GENERATOR: Ninja | |
CTEST_PARALLEL_LEVEL: 2 | |
on: | |
push: | |
- "**/CMakeLists.txt" | |
- "**.cmake" | |
- "**.cmake.in" | |
- "**.c" | |
- "**.h" | |
- "**.h.in" | |
- ".github/workflows/ci_cmake.yml" | |
pull_request: | |
jobs: | |
windows: | |
runs-on: windows-latest | |
name: CMake build on Windows | |
timeout-minutes: 15 | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: >- | |
mingw-w64-x86_64-cmake | |
mingw-w64-x86_64-ninja | |
mingw-w64-x86_64-msmpi | |
- name: Put MSYS2_MinGW64 on PATH | |
# there is not yet an environment variable for this path from msys2/setup-msys2 | |
run: echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: download MS-MPI setup (SDK is from MSYS2) | |
run: curl -L -O https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe | |
- name: Install mpiexec.exe (-force needed to bypass GUI on headless) | |
run: .\msmpisetup.exe -unattend -force | |
- name: test that mpiexec.exe exists | |
# can't use MSMPI_BIN as Actions doesn't update PATH from msmpisetup.exe | |
run: Test-Path "C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -PathType leaf | |
- name: put MSMPI_BIN on PATH (where mpiexec is) | |
run: echo "C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- uses: actions/checkout@v2 | |
name: Checkout source code | |
# example build, whatever your project needs below | |
- name: CMake configure | |
run: cmake -B build | |
- name: CMake build | |
run: cmake --build build | |
- name: CMake self-tests | |
run: ctest --test-dir build --output-on-failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated for MSYS2 v2.5.0