Skip to content

upd: splitted build workflows into separate scripts #1

upd: splitted build workflows into separate scripts

upd: splitted build workflows into separate scripts #1

name: Build (Windows MSYS2)
on:
push:
branches:
- main
paths-ignore:
- '**/README.md'
pull_request:
branches:
- main
jobs:
build-msys2:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: true
matrix:
build_type: ["Release"]
cmake_generator: ["Ninja"]
shared_libs_enabled: ["ON", "OFF"]
config:
- { sys: mingw32, env: i686, cc: gcc, cxx: g++ }
- { sys: mingw32, env: i686, cc: clang, cxx: clang++ }
- { sys: mingw64, env: x86_64, cc: gcc, cxx: g++ }
- { sys: mingw64, env: x86_64, cc: clang, cxx: clang++ }
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/[email protected]
with:
msystem: ${{ matrix.config.sys }}
install: >-
mingw-w64-${{ matrix.config.env }}-gcc
mingw-w64-${{ matrix.config.env }}-clang
mingw-w64-${{ matrix.config.env }}-make
mingw-w64-${{ matrix.config.env }}-cmake
mingw-w64-${{ matrix.config.env }}-ninja
- name: Set reusable strings
id: strings
run: |
echo "build-output-dir=$(cygpath -u '${{ github.workspace }}')/build" >> "$GITHUB_OUTPUT"
echo "source-dir=$(cygpath -u '${{ github.workspace }}')" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake
-G ${{ matrix.cmake_generator }}
-S ${{ steps.strings.outputs.source-dir }}
-B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_C_COMPILER=${{ matrix.config.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs_enabled }}
- name: Build
run: >
cmake
--build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ matrix.build_type }}