Skip to content

Commit 81387bc

Browse files
add push_ci.yml for running CI/CD pipeline for push action for the feature branches and forced the PR for only the dev and main branches
1 parent ea3fd82 commit 81387bc

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

.github/workflows/ci.yml .github/workflows/pr_ci.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
name: CI/CD
1+
name: Pull Request CI
22

33
on: # On what action this workflow will be triggered
4-
push:
5-
branches:
6-
- feature/*
7-
- fix/*
8-
- release/*
94
pull_request:
105
branches:
116
- main
127
- dev
138

149
jobs:
1510
build:
16-
name: Build and Test # Give the build job an appropriate name
11+
name: Build & Run All Tests # Give the build job an appropriate name
1712
runs-on: ubuntu-latest
1813

1914
steps:

.github/workflows/push_ci.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Push CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'feature/*'
7+
8+
jobs:
9+
build:
10+
name: Build & Run All Tests
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4 # to use node20 instead of node12 and node 16 which are deprecated
16+
17+
- name: Set up CMake
18+
uses: jwlawson/actions-setup-cmake@v2 # Use the latest major version for stability
19+
with:
20+
cmake-version: '3.26.3'
21+
22+
- name: Install dependencies
23+
run: sudo apt-get install -y libgtest-dev libgmock-dev clang-tidy lcov #clang-format
24+
25+
- name: Configure CMake
26+
run: |
27+
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_STANDARD=20 ..
28+
29+
- name: Build Main Executable and Test Executable
30+
run: |
31+
cmake --build build
32+
33+
- name: Run Unit Tests
34+
run: |
35+
cd build
36+
ctest -R UnitTests--output-on-failure

0 commit comments

Comments
 (0)