Skip to content

Commit

Permalink
.github/workflows/cmake: use matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsh committed Oct 22, 2023
1 parent f0555b0 commit 6af3ce6
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 10 deletions.
64 changes: 54 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
permissions:
contents: write
runs-on: windows-latest
runs-on: ${{ matrix.os }}
steps:
- id: fixed_workspace
name: Fix path
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions .vscode/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ analyzer
appdata
autogen
bindir
bitness
cmder
codeql
color
Expand Down Expand Up @@ -41,12 +42,15 @@ mktemp
mscgen
msvc
msvcrt
msys
msystem
municode
nsis
nxcompat
objbase
olaf
outfile
pacboy
parens
pidl
popen
Expand All @@ -69,6 +73,7 @@ strequal
struct
tatsh
tlbid
ucrt
udvare
useb
userprofile
Expand Down

0 comments on commit 6af3ce6

Please sign in to comment.