Skip to content

Commit

Permalink
Add test matrix for ninja + cl / clang-cl
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwe committed Sep 16, 2023
1 parent afd346d commit 5ca0581
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 19 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,61 @@ jobs:
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3

windows_ninja_cl:
name: Test Windows Visual Studio
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
arch:
- x86_64
- i686
- aarch64
compiler:
- cl
- clang-cl
include:
- os: windows-2022
vs_version: vs-2022
cmake: 3.22.6
- rust: 1.54.0
# Override rust version for x86_64
- arch: x86_64
rust: 1.46.0
# Add variable mapping for ilammy/msvc-dev-cmd action
- arch: x86_64
msvc_dev_arch: amd64
- arch: i686
msvc_dev_arch: amd64_x86
- arch: aarch64
msvc_dev_arch: amd64_arm64

steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: corrosion-rs/install-cmake@v2
with:
cmake: ${{ matrix.cmake }}
ninja: 1.10.0
- name: Install Rust
id: install_rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-pc-windows-msvc
- name: Setup MSVC Development Environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc_dev_arch }}
if: matrix.compiler == 'cl'
- name: New configure
run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "ninja-${{ matrix.arch }}-pc-windows-msvc-${{ matrix.compiler }}"
- name: Run Tests
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3

# test_cxxbridge:
# name: Test cxxbridge integration
# runs-on: ${{ matrix.os }}
Expand Down
32 changes: 13 additions & 19 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,30 @@
"inherits": ["vs-platform-arm64", "vs-2022"]
},
{
"name": "_compiler",
"name": "clang",
"hidden": true,
"cacheVariables": {
"CMAKE_C_COMPILER": "${presetName}",
"CMAKE_CXX_COMPILER": "${presetName}"
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "clang",
"hidden": true,
"inherits": ["_compiler"]
},
{
"name": "clang-cl",
"hidden": true,
"inherits": ["_compiler"]
"inherits": ["windows-only"],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl"
}
},
{
"name": "cl",
"hidden": true,
"inherits": ["_compiler"]
},
{
"name": "gcc",
"hidden": true,
"inherits": ["_compiler"]
"inherits": ["windows-only"],
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl"
}
},
{
"name": "ninja-x86_64-pc-windows-msvc-cl",
Expand All @@ -170,10 +168,6 @@
{
"name": "ninja-x86_64-pc-windows-gnu-clang",
"inherits": ["ninja", "x86_64-pc-windows-gnu", "clang"]
},
{
"name": "ninja-x86_64-pc-windows-gnu-gcc",
"inherits": ["ninja", "x86_64-pc-windows-gnu", "gcc"]
}
]
}

0 comments on commit 5ca0581

Please sign in to comment.