init commit
This commit is contained in:
36
.github/workflow/ci.yaml
vendored
Normal file
36
.github/workflow/ci.yaml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: C++ CI/CD Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "master" ]
|
||||
pull_request:
|
||||
branches: [ "main", "master" ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake cppcheck build-essential
|
||||
|
||||
- name: Run Static Analysis (Cppcheck)
|
||||
run: |
|
||||
cppcheck --enable=all --language=c++ --error-exitcode=1 main.cpp test.cpp
|
||||
# Флаг --error-exitcode=1 остановит пайплайн, если найдутся критические ошибки
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
- name: Build Project
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Run Tests (CTest)
|
||||
run: |
|
||||
cd build
|
||||
ctest --output-on-failure
|
||||
Reference in New Issue
Block a user