Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GitHub Actions CI MSYS2 with MS-MPI on Windows
name: CI CMake
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: >-
git
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 "D:/a/_temp/msys/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 -G Ninja
- name: CMake build
run: cmake --build build
- name: CMake self-tests
run: ctest --parallel 2 --output-on-failure
working-directory: build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment