Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eacc9c88e8 | ||
| 4efbea085d | |||
| e08c4aeb61 | |||
| fb2289214f | |||
| a6862e77e4 | |||
| 1e4648aa21 | |||
| 065a073866 | |||
| 53d1693a1c | |||
| b97560c3a6 | |||
| 33063dcff9 | |||
| 017b48f6e8 | |||
| 50d47529f8 | |||
|
|
a0e2003e01 |
60
.gitea/workflows/ci.yml
Normal file
60
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
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
|
||||
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Calculator VERSION 1.0 LANGUAGES C)
|
||||
project(Calculator C)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
@@ -15,5 +15,4 @@ target_include_directories(test_calculator PRIVATE include)
|
||||
|
||||
add_test(NAME CalculatorTests COMMAND test_calculator)
|
||||
|
||||
install(TARGETS calculator main DESTINATION bin)
|
||||
install(FILES include/calculator.h DESTINATION include)
|
||||
install(TARGETS calculator test_calculator DESTINATION bin)
|
||||
@@ -17,4 +17,4 @@ double divide(int a, int b) {
|
||||
return 0.0;
|
||||
}
|
||||
return (double)a / b;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user