From edfcf5f343f4621a95e01458de35d696722b44bd Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Sun, 22 Oct 2023 05:40:44 -0400 Subject: [PATCH] .github/workflows/cmake: use matrix --- .github/workflows/cmake.yml | 64 +++++++++++++++++++++++++++++++------ .vscode/dictionary.txt | 4 +++ 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a5c717c..c1bb65a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -5,7 +5,7 @@ jobs: build: permissions: contents: write - runs-on: windows-latest + runs-on: ${{ matrix.os }} steps: - id: fixed_workspace name: Fix path @@ -23,22 +23,66 @@ jobs: run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose - name: Install run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Install NSIS - run: | - iwr -useb get.scoop.sh -outfile 'install.ps1' - .\install.ps1 -RunAsAdmin - scoop update - scoop bucket add extras - scoop install nsis - - name: Package + - if: matrix.os == 'windows-2022' + name: Package run: cpack -C ${{env.BUILD_TYPE}} --config ${{github.workspace}}/build/CPackConfig.cmake - - name: Upload package + - if: matrix.os == 'windows-2022' + name: Upload package uses: softprops/action-gh-release@v1 with: files: | ${{steps.fixed_workspace.outputs.out}}/winprefs-*.exe ${{steps.fixed_workspace.outputs.out}}/winprefs-*.zip tag_name: ${{ steps.latest_tag.outputs.tag }} + strategy: + fail-fast: false + matrix: + os: + - windows-2019 + - windows-2022 + build_msys: + runs-on: windows-latest + steps: + - id: fixed_workspace + name: Fix path + run: | + echo out=$("${{github.workspace}}" -Replace "\\","/") | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + - uses: msys2/setup-msys2@v2 + with: + install: >- + make + msystem: ${{matrix.sys.name}} + pacboy: >- + cmake:p + ninja:p + toolchain:p + update: true + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Configure (32-bit) + run: cmake -G Ninja -B ${{steps.fixed_workspace.outputs.out}}/build --install-prefix ${{steps.fixed_workspace.outputs.out}}/build/prefix -DWITH_64BIT=OFF + if: matrix.sys.bits == '32' + shell: 'msys2 {0}' + - name: Configure (64-bit) + run: cmake -G Ninja -B ${{steps.fixed_workspace.outputs.out}}/build --install-prefix ${{steps.fixed_workspace.outputs.out}}/build/prefix -DWITH_64BIT=ON + if: matrix.sys.bits == '64' + shell: 'msys2 {0}' + - name: Build + run: cmake --build ${{steps.fixed_workspace.outputs.out}}/build --config ${{env.BUILD_TYPE}} --verbose + shell: 'msys2 {0}' + - name: Install + run: cmake --install ${{steps.fixed_workspace.outputs.out}}/build --config ${{env.BUILD_TYPE}} + shell: 'msys2 {0}' + strategy: + fail-fast: false + matrix: + sys: + - { name: clang32, env: clang-i686, bits: '32' } + - { name: clang64, env: clang-x86_64, bits: '64' } + - { name: mingw32, env: i686, bits: '32' } + - { name: mingw64, env: x86_64, bits: '64' } + - { name: ucrt64, env: ucrt-x86_64, bits: '64' } name: Build 'on': pull_request: diff --git a/.vscode/dictionary.txt b/.vscode/dictionary.txt index afb7109..17a8d31 100644 --- a/.vscode/dictionary.txt +++ b/.vscode/dictionary.txt @@ -2,6 +2,7 @@ analyzer appdata autogen bindir +bitness cmder codeql color @@ -41,6 +42,8 @@ mktemp mscgen msvc msvcrt +msys +msystem municode nsis nxcompat @@ -69,6 +72,7 @@ strequal struct tatsh tlbid +ucrt udvare useb userprofile