Skip to content

Commit ce67b3e

Browse files
committed
Create examples workflow
1 parent 15a7974 commit ce67b3e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/examples.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: examples
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
fail-fast: true
15+
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
build_type: [Debug, Release]
19+
c_compiler: [gcc, clang, cl]
20+
include:
21+
- os: windows-latest
22+
c_compiler: cl
23+
cpp_compiler: cl
24+
- os: ubuntu-latest
25+
c_compiler: gcc
26+
cpp_compiler: g++
27+
- os: ubuntu-latest
28+
c_compiler: clang
29+
cpp_compiler: clang++
30+
- os: macos-latest
31+
c_compiler: clang
32+
cpp_compiler: clang++
33+
exclude:
34+
- os: windows-latest
35+
c_compiler: gcc
36+
- os: windows-latest
37+
c_compiler: clang
38+
- os: ubuntu-latest
39+
c_compiler: cl
40+
- os: macos-latest
41+
c_compiler: cl
42+
- os: macos-latest
43+
c_compiler: gcc
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set reusable strings
49+
id: strings
50+
shell: bash
51+
run: |
52+
echo "build-output-dir=${{ github.workspace }}/build-examples" >> "$GITHUB_OUTPUT"
53+
54+
- name: Configure CMake
55+
run: >
56+
cmake examples -B ${{ steps.strings.outputs.build-output-dir }}
57+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
58+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
59+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
60+
-S ${{ github.workspace }}
61+
62+
- name: Build examples
63+
run: cmake examples --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

0 commit comments

Comments
 (0)