Skip to content

Commit 5f9784b

Browse files
committed
Add CI pipeline using Github Actions
1 parent 3ab87dc commit 5f9784b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: C++ CI Workflow
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
# Job that builds, configures, and tests the repository
7+
build:
8+
name: '[${{ matrix.os }}@${{ matrix.build_type }}]'
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
build_type: [Debug, Release]
13+
os: [ubuntu-latest, windows-latest, macOS-latest]
14+
15+
steps:
16+
# Clone the repository in $GITHUB_WORKSPACE
17+
- uses: actions/checkout@master
18+
19+
# Note: we use bash also on Windows in order to have the same commands such
20+
# as cd, mkdir, etc in all OSs.
21+
22+
- name: Configure
23+
shell: bash
24+
run: |
25+
mkdir -p build
26+
cd build
27+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
28+
29+
- name: Build
30+
shell: bash
31+
run: |
32+
cd build
33+
cmake --build . --config ${{ matrix.build_type }}
34+
35+
- name: Test
36+
shell: bash
37+
run: |
38+
cd build
39+
cmake -DBUILD_TESTING:BOOL=ON .
40+
cmake --build . --config ${{ matrix.build_type }}
41+
ctest --output-on-failure -C ${{ matrix.build_type }} .

0 commit comments

Comments
 (0)