This commit is contained in:
31
.gitea/workflows/ci.yml
Normal file
31
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Copy
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: download cppcheck
|
||||
run: sudo apt update && sudo apt install -y cppcheck
|
||||
|
||||
- name: run cppcheck
|
||||
run: cppcheck project_cpp/
|
||||
|
||||
- name: run tests
|
||||
run: make test
|
||||
|
||||
- name: build
|
||||
run: make
|
||||
|
||||
- name: run
|
||||
run: ./main
|
||||
|
||||
|
||||
|
||||
|
||||
13
Makefile
Normal file
13
Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
CC = g++
|
||||
|
||||
all: main
|
||||
|
||||
main: project_cpp/main.cpp tests/tests.cpp
|
||||
$(CC) -o main
|
||||
|
||||
test: tests/tests.cpp
|
||||
$(CC) tests/tests.cpp -o test
|
||||
./test
|
||||
|
||||
clean:
|
||||
rm -f main test
|
||||
@@ -18,9 +18,12 @@ int devide (int a, int b) {
|
||||
return round(a / b);
|
||||
}
|
||||
|
||||
// int main () {
|
||||
int main () {
|
||||
std::cout << "ADD: " << add(4, 5) << "\n";
|
||||
std::cout << "ADD: " << substraction(13, 9) << "\n";
|
||||
std::cout << "ADD: " << multiple(4,2) << "\n";
|
||||
std::cout << "ADD: " << devide(4,2) << "\n";
|
||||
|
||||
|
||||
|
||||
// return 0;
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
@@ -53,5 +53,6 @@ int main () {
|
||||
substraction_test();
|
||||
multiple_test();
|
||||
devide_test();
|
||||
std::cout << "ALL PASSED!!!";
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user