Skip to content

Commit 042440d

Browse files
Create cmake-multi-platform.yml
1 parent d84b899 commit 042440d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CMake on multiple platforms
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: false
15+
matrix:
16+
os: [ubuntu-latest]
17+
build_type: [Release, Debug]
18+
cpp_compiler: [g++, clang++]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Set reusable strings
24+
id: strings
25+
shell: bash
26+
run: |
27+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
28+
29+
- name: Configure CMake
30+
run: >
31+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
32+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
33+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
34+
-S ${{ github.workspace }}
35+
36+
- name: Build
37+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
38+
39+
- name: Test
40+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
41+
run: ./tests >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)