Skip to content

Commit

Permalink
Add CMake workflow for Windows ARM64 support
Browse files Browse the repository at this point in the history
Created a new GitHub Actions workflow for building and testing CMake projects on Windows ARM64. This includes a matrix strategy for different C++ versions (11, 14, 17, 20) and updates the existing CMake configuration to streamline the build process. Removed conditional architecture checks in the previous workflow to simplify the configuration steps.
  • Loading branch information
yanyiwu committed Jan 18, 2025
1 parent 912a0a7 commit 7e1fd43
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cmake-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CMake Windows ARM64

on:
push:
pull_request:

env:
BUILD_TYPE: Release

jobs:
build-windows-arm64:
runs-on: windows-2022
strategy:
matrix:
cpp_version: [11, 14, 17, 20]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Configure CMake
shell: bash
run: cmake -B ${{github.workspace}}/build -A ARM64 -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${{matrix.cpp_version}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --verbose
18 changes: 1 addition & 17 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ jobs:
windows-2022,
]
cpp_version: [11, 14, 17, 20]
include:
- os: windows-2022
cpp_version: 11
arch: ARM64
- os: windows-2022
cpp_version: 20
arch: ARM64

steps:
- name: Check out repository code
Expand All @@ -41,21 +34,12 @@ jobs:

- name: Configure CMake
shell: bash
run: |
if [[ "${{ matrix.arch }}" == "ARM64" ]]; then
cmake -B "${{github.workspace}}/build" -A ARM64 -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${{matrix.cpp_version}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
else
cmake -B "${{github.workspace}}/build" -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${{matrix.cpp_version}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
fi
run: cmake -B ${{github.workspace}}/build -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${{matrix.cpp_version}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} --verbose

0 comments on commit 7e1fd43

Please sign in to comment.