-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Corrosion with Visual Studio | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
vs_version: | ||
required: true | ||
type: string | ||
default: 2022 | ||
cmake: | ||
required: false | ||
type: string | ||
default: "3.22.6" | ||
rust: | ||
required: false | ||
type: string | ||
default: 1.46.0 | ||
target_arch: | ||
required: false | ||
type: string | ||
default: x86_64 | ||
|
||
jobs: | ||
visual_studio: | ||
name: Test Visual Studio ${{ inputs.vs_version }} | ||
runs-on: "windows-${{ inputs.vs_version }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install CMake | ||
uses: corrosion-rs/install-cmake@v2 | ||
with: | ||
cmake: ${{ inputs.cmake }} | ||
ninja: 1.10.0 | ||
- name: Install Rust | ||
id: install_rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{inputs.rust}} | ||
targets: ${{inputs.target_arch}}-pc-windows-msvc | ||
# The initial configure for MSVC is quite slow, so we cache the build directory | ||
# (including the build directories of the tests) since reconfiguring is | ||
# significantly faster. | ||
- name: Cache MSVC build directory | ||
id: cache-msvc-builddir | ||
uses: actions/cache@v3 | ||
with: | ||
path: build | ||
key: ${{ inputs.os }}-${{ inputs.target_arch }}-${{ inputs.rust }}-msvc-build | ||
- name: New configure | ||
run: cmake -S. -Bbuild -DCORROSION_TESTS_KEEP_BUILDDIRS=ON "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "vs-${{ inputs.vs_version }}-${{ inputs.target_arch }}" | ||
- name: Run Tests | ||
working-directory: build | ||
run: ctest --output-on-failure --build-config Debug -j 3 |