Skip to content

Instantly share code, notes, and snippets.

@scivision
Last active Oct 21, 2021
Embed
What would you like to do?
GitHub Actions CI MSYS2 with MS-MPI on Windows
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: >-
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/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
@scivision
Copy link
Author

scivision commented Oct 21, 2021

updated for MSYS2 v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment