16038
|
1 |
name: Corrosion with Visual Studio
|
|
2 |
|
|
3 |
on:
|
|
4 |
workflow_call:
|
|
5 |
inputs:
|
|
6 |
vs_version:
|
|
7 |
required: true
|
|
8 |
type: string
|
|
9 |
default: 2022
|
|
10 |
cmake:
|
|
11 |
required: false
|
|
12 |
type: string
|
|
13 |
default: "3.22.6"
|
|
14 |
rust:
|
|
15 |
required: false
|
|
16 |
type: string
|
|
17 |
default: 1.46.0
|
|
18 |
target_arch:
|
|
19 |
required: false
|
|
20 |
type: string
|
|
21 |
default: x86_64
|
|
22 |
|
|
23 |
jobs:
|
|
24 |
visual_studio:
|
|
25 |
name: Test Visual Studio ${{ inputs.vs_version }}
|
|
26 |
runs-on: "windows-${{ inputs.vs_version }}"
|
|
27 |
steps:
|
|
28 |
- uses: actions/checkout@v4
|
|
29 |
- name: Install CMake
|
|
30 |
uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
|
|
31 |
with:
|
|
32 |
cmakeVersion: "${{ inputs.cmake }}"
|
|
33 |
ninjaVersion: "~1.10.0"
|
|
34 |
- name: Install Rust
|
|
35 |
id: install_rust
|
|
36 |
uses: dtolnay/rust-toolchain@master
|
|
37 |
with:
|
|
38 |
toolchain: ${{inputs.rust}}
|
|
39 |
targets: ${{inputs.target_arch}}-pc-windows-msvc
|
|
40 |
# The initial configure for MSVC is quite slow, so we cache the build directory
|
|
41 |
# (including the build directories of the tests) since reconfiguring is
|
|
42 |
# significantly faster.
|
|
43 |
- name: Cache MSVC build directory
|
|
44 |
id: cache-msvc-builddir
|
|
45 |
uses: actions/cache@v4
|
|
46 |
with:
|
|
47 |
path: build
|
|
48 |
key: ${{ inputs.os }}-${{ inputs.target_arch }}-${{ inputs.rust }}-msvc-${{ inputs.vs_version}}-build
|
|
49 |
- name: Configure
|
|
50 |
run: cmake -S. -Bbuild -DCORROSION_TESTS_KEEP_BUILDDIRS=ON "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "vs-${{ inputs.vs_version }}-${{ inputs.target_arch }}"
|
|
51 |
- name: Run Tests
|
|
52 |
working-directory: build
|
|
53 |
run: ctest --output-on-failure --build-config Debug -j 3
|