-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.29 KB
/
examples.yml
File metadata and controls
48 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: examples
on:
workflow_call:
inputs:
os:
description: 'Operating system to run the job on (ubuntu-latest, windows-latest, macos-latest)'
required: true
type: string
cxx_compilers:
description: 'List of compilers to use'
required: true
type: string
jobs:
examples:
runs-on: ${{ inputs.os }}
strategy:
fail-fast: true
matrix:
cxx_compiler: ${{ fromJSON(inputs.cxx_compilers) }}
build_type: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup build directory
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build.examples" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake
-B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}/examples
- name: Build examples
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Run examples
run: ctest --output-on-failure --build-config ${{ matrix.build_type }} --test-dir ${{ steps.strings.outputs.build-output-dir }}