3 Commits

Author SHA1 Message Date
8cfc0c3825 Обновить CMakeLists.txt 2026-05-16 19:52:01 +03:00
102e272b6c Обновить CMakeLists.txt 2026-05-16 19:50:47 +03:00
f272af142b Обновить src/calculator.c 2026-05-16 19:46:16 +03:00
3 changed files with 4 additions and 63 deletions

View File

@@ -1,60 +0,0 @@
name: CI Pipeline
on:
push:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install cppcheck
run: |
sudo apt-get update
sudo apt-get install -y cppcheck
- name: Run cppcheck
run: |
cppcheck --enable=all -I include/ --suppress=missingIncludeSystem src/ tests/ --error-exitcode=1
test:
name: Test
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Build and test
run: |
cmake -B build
cmake --build build
cd build && ctest --output-on-failure
build:
name: Build
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Build Release
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(Calculator C)
project(Calculator VERSION 1.0 LANGUAGES C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -15,4 +15,5 @@ target_include_directories(test_calculator PRIVATE include)
add_test(NAME CalculatorTests COMMAND test_calculator)
install(TARGETS calculator test_calculator DESTINATION bin)
install(TARGETS calculator main DESTINATION bin)
install(FILES include/calculator.h DESTINATION include)

View File

@@ -17,4 +17,4 @@ double divide(int a, int b) {
return 0.0;
}
return (double)a / b;
}
}