-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (27 loc) · 1018 Bytes
/
Copy pathc-cpp.yml
File metadata and controls
34 lines (27 loc) · 1018 Bytes
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
name: C/C++ CI
# This triggers the workflow on pushes and pull requests to the main branch
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
build-and-test:
# Runs on the latest Ubuntu environment provided by GitHub
runs-on: ubuntu-latest
steps:
# 1. Check out the code from your repository
- name: Checkout repository
uses: actions/checkout@v4
# 2. Run CMake configuration (downloads gtest and generates Makefiles)
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -S ${{github.workspace}}
# 3. Compile the core library, main app, and unit tests
- name: Build Project
run: cmake --build ${{github.workspace}}/build
# 4. Run the unit tests using CTest
- name: Run Unit Tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
- name: Run Linting with Clang Tidy
run: find src/ -type f -name "*.cpp" | xargs clang-tidy -p build/