16021
|
1 |
name: Test Corrosion using prebuilt legacy generator
|
|
2 |
|
|
3 |
on:
|
|
4 |
workflow_call:
|
|
5 |
inputs:
|
|
6 |
os:
|
|
7 |
required: true
|
|
8 |
type: string
|
|
9 |
rust:
|
|
10 |
required: false
|
|
11 |
type: string
|
|
12 |
default: 1.46.0
|
|
13 |
target_arch:
|
|
14 |
required: false
|
|
15 |
type: string
|
|
16 |
default: x86_64
|
|
17 |
generator:
|
|
18 |
required: false
|
|
19 |
type: string
|
|
20 |
default : ninja
|
|
21 |
|
|
22 |
jobs:
|
|
23 |
test_legacy:
|
|
24 |
name: Test (${{inputs.os}})
|
|
25 |
runs-on: ${{ inputs.os }}
|
|
26 |
strategy:
|
|
27 |
fail-fast: false
|
|
28 |
steps:
|
|
29 |
- uses: actions/checkout@v4
|
|
30 |
- name: Cache Legacy Generator
|
|
31 |
id: cache_generator
|
|
32 |
uses: actions/cache@v4
|
|
33 |
with:
|
|
34 |
path: ${{github.workspace}}/corrosion-prebuilt-generator
|
|
35 |
key: ${{ runner.os }}-${{ inputs.rust }}-generator-${{ hashFiles('generator/src/**', 'generator/Cargo.toml', 'generator/Cargo.lock') }}
|
|
36 |
- name: Setup Environment and Configure CMake
|
|
37 |
uses: "./.github/actions/setup_test"
|
|
38 |
with:
|
|
39 |
target_arch: x86_64
|
|
40 |
cmake: 3.15.7
|
|
41 |
rust: ${{inputs.rust}}
|
|
42 |
generator: ninja
|
|
43 |
build_dir: build
|
|
44 |
install_path: ${{github.workspace}}/corrosion-prebuilt-generator
|
|
45 |
configure_params: "-DCMAKE_BUILD_TYPE=Release"
|
|
46 |
if: steps.cache_generator.outputs.cache-hit != 'true'
|
|
47 |
- name: Build corrosion
|
|
48 |
run: cmake --build build --config Release
|
|
49 |
if: steps.cache_generator.outputs.cache-hit != 'true'
|
|
50 |
- name: Install corrosion
|
|
51 |
run: cmake --install build --config Release
|
|
52 |
if: steps.cache_generator.outputs.cache-hit != 'true'
|
|
53 |
- name: Determine Corrosion Generator path
|
|
54 |
id: cor_gen
|
|
55 |
shell: bash
|
|
56 |
run: |
|
|
57 |
export base_generator_bin="${{github.workspace}}/corrosion-prebuilt-generator/libexec/corrosion-generator"
|
|
58 |
if [ "${{ runner.os }}" == "Windows" ]; then
|
|
59 |
echo "generator_bin=${base_generator_bin}.exe" >> $GITHUB_OUTPUT
|
|
60 |
else
|
|
61 |
echo "generator_bin=${base_generator_bin}" >> $GITHUB_OUTPUT
|
|
62 |
chmod +x "${base_generator_bin}"
|
|
63 |
fi
|
|
64 |
- name: Setup Environment and Configure CMake
|
|
65 |
uses: "./.github/actions/setup_test"
|
|
66 |
with:
|
|
67 |
target_arch: ${{inputs.target_arch}}
|
|
68 |
cmake: 3.15.7
|
|
69 |
rust: ${{inputs.rust}}
|
|
70 |
generator: ${{inputs.generator}}
|
|
71 |
build_dir: build
|
|
72 |
configure_params: "-DCORROSION_GENERATOR_EXECUTABLE=${{steps.cor_gen.outputs.generator_bin}}"
|
|
73 |
- name: Run Tests
|
|
74 |
id: run_tests
|
|
75 |
working-directory: build
|
|
76 |
run: ctest --build-config Debug -j 3
|
|
77 |
- name: Rerun failed tests verbose
|
|
78 |
working-directory: build
|
|
79 |
run: ctest --rerun-failed --verbose --build-config Debug
|
|
80 |
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }} |