Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a9cdaec
Update main.cpp
oshkines Feb 28, 2026
2d62d5f
Update main.cpp
oshkines Feb 28, 2026
de47e1b
FileIgnore
oshkines Mar 4, 2026
d90317c
Lesson2
oshkines Mar 5, 2026
5802d73
Update release.yml
oshkines Mar 5, 2026
54c7558
Update main.cpp
oshkines Mar 5, 2026
2ed0fe9
Update release.yml
oshkines Mar 5, 2026
0eeecc3
Trigger Actions
oshkines Mar 5, 2026
38392f5
Update releaseAddMain.yml
oshkines Mar 5, 2026
04384be
Update release.yml
oshkines Mar 5, 2026
317a1bf
Update release.yml
oshkines Mar 5, 2026
d52f3db
Update CMakeLists.txt
oshkines Mar 5, 2026
5a106fc
Lesson6: Actual version
oshkines Mar 28, 2026
130a928
Lesson6: Actual version v.2
oshkines Mar 28, 2026
42eaa5c
correct name project Lesson6 for Update release.yml
oshkines Mar 28, 2026
37aa355
Lesson7: SFINAE + Doxygen
oshkines Apr 11, 2026
3425b3c
Merge branch 'main' of https://github.com/oshkines/otus-cpp-prof
oshkines Apr 11, 2026
5386d0a
Update release.yml
oshkines Apr 11, 2026
18d8e84
Lesson7: SFINAE + Doxygen v2.0
oshkines Apr 11, 2026
83e4ce0
Merge branch 'main' of https://github.com/oshkines/otus-cpp-prof
oshkines Apr 11, 2026
1fc4db9
Update CMakeLists.txt
oshkines Apr 11, 2026
ddb5e3b
Lesson7: SFINAE + Doxygen v3.0
oshkines Apr 11, 2026
587c363
Merge branch 'main' of https://github.com/oshkines/otus-cpp-prof
oshkines Apr 11, 2026
bda5f6c
Add Docker build and CI/CD workflow
oshkines Apr 13, 2026
f778027
Add Pages deployment
oshkines Apr 13, 2026
a3f7738
Fix documentation path in workflow
oshkines Apr 13, 2026
2461782
Finish Homework Editor
oshkines Apr 14, 2026
5b98733
Fix diagrams visibility on GH Pages
oshkines Apr 14, 2026
64a29f9
Fix diagrams visibility on GH Pages 2
oshkines Apr 14, 2026
510d2da
Fix diagrams visibility on GH Pages 3
oshkines Apr 14, 2026
bb8889e
Fix diagrams visibility on GH Pages 4
oshkines Apr 14, 2026
cf34f76
Fix diagrams visibility on GH Pages 5
oshkines Apr 14, 2026
7e9fcf9
Fix diagrams visibility on GH Pages 6
oshkines Apr 14, 2026
3d2d966
Add Doxygen documentation for bulk___
oshkines May 11, 2026
f646d4c
Add Doxygen documentation
oshkines May 11, 2026
ec7e830
Finish Homework 18 final doxygen
oshkines May 11, 2026
edc69a4
Re-run docs generation
oshkines May 11, 2026
9e29374
Fix: add check for negative block size
oshkines May 13, 2026
9ec844e
Finish Homework 22
oshkines Jun 11, 2026
ee018c7
Lesson 26
oshkines Jun 23, 2026
ce57639
Finish Homework 10 Lesson30
oshkines Jul 5, 2026
9ef6a27
Finish Homework 32 sqlite3server
oshkines Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- name: Install Doxygen and Graphviz
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz

- name: Check dot version
# Эта команда покажет в логах, работает ли Graphviz вообще
run: dot -V

- name: Generate Documentation
run: doxygen Doxyfile

- name: Check for generated images
# Это покажет, появились ли PNG файлы до деплоя
run: ls docs/html/*.png || echo "PNG FILES NOT FOUND"

- name: Add .nojekyll
run: touch ./docs/html/.nojekyll

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/html
publish_branch: gh-pages
68 changes: 39 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
name: 'C++ CI'
name: Build and Release

on:
push:
branches:
- master
- feature/github_actions
tags:
- 'v*'

jobs:
build:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: sudo apt-get update && sudo apt-get install libboost-test-dev -y
- run: cmake . -DPATCH_VERSION=${{ github.run_number }} -DWITH_BOOST_TEST=ON
- run: cmake --build .
- run: cmake --build . --target test
- run: cmake --build . --target package
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4

- name: Build in Docker
run: |
# 1. Собираем образ
docker build -t builder .

# 2. Создаем временный контейнер для копирования файлов
docker create --name extractor builder

# 3. Подготавливаем папки на сервере GitHub
mkdir -p dist

# 4. Копируем .deb пакет из папки /output контейнера
docker cp extractor:/output/. ./dist/

# 5. Копируем документацию.
# Путь /build/docs/html так как в Doxyfile OUTPUT_DIRECTORY = docs
docker cp extractor:/build/docs/html/. ./dist-docs

# 6. Удаляем контейнер
docker rm extractor

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
files: dist/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./helloworld-0.0.${{ github.run_number }}-Linux.deb
asset_name: helloworld-0.0.${{ github.run_number }}-Linux.deb
asset_content_type: application/vnd.debian.binary-package
folder: dist-docs
branch: gh-pages
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/.idea/
**/.settings/
**/.vscode/
**/build/
**/debug/
**/release/
html/
latex/
*.deb
dist/
output/
*.pdb
109 changes: 39 additions & 70 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,86 +1,55 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.15)
project(sqlite3server VERSION 5.2.1)

set(PATCH_VERSION "1" CACHE INTERNAL "Patch version")
set(PROJECT_VESRION 0.0.${PATCH_VERSION})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(helloworld VERSION ${PROJECT_VESRION})
find_package(Boost REQUIRED COMPONENTS system)
find_package(SQLite3 REQUIRED)

option(WITH_BOOST_TEST "Whether to build Boost test" ON)

configure_file(version.h.in version.h)

add_executable(helloworld_cli main.cpp)
add_library(helloworld lib.cpp)

set_target_properties(helloworld_cli helloworld PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
add_executable(sqlite3server
src/main.cpp
src/DatabaseManager.cpp
src/CommandParser.cpp
)

target_include_directories(helloworld
PRIVATE "${CMAKE_BINARY_DIR}"
target_include_directories(sqlite3server
PRIVATE
src
${SQLite3_INCLUDE_DIRS}
)

target_link_libraries(helloworld_cli PRIVATE
helloworld
target_link_libraries(sqlite3server
PRIVATE
${Boost_LIBRARIES}
${SQLite3_LIBRARIES}
)

if(WITH_BOOST_TEST)
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
add_executable(test_version test_version.cpp)

set_target_properties(test_version PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
)
if(MSVC)
target_compile_options(sqlite3server PRIVATE /W4)
else()
target_compile_options(sqlite3server PRIVATE -Wall -Wextra -pedantic)
endif()

set_target_properties(test_version PROPERTIES
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}
)

target_link_libraries(test_version
${Boost_LIBRARIES}
helloworld
)
endif()
install(TARGETS sqlite3server
RUNTIME DESTINATION bin
)

if (MSVC)
target_compile_options(helloworld_cli PRIVATE
/W4
)
target_compile_options(helloworld PRIVATE
/W4
)
if(WITH_BOOST_TEST)
target_compile_options(test_version PRIVATE
/W4
)
endif()
else ()
target_compile_options(helloworld_cli PRIVATE
-Wall -Wextra -pedantic -Werror
)
target_compile_options(helloworld PRIVATE
-Wall -Wextra -pedantic -Werror
)
if(WITH_BOOST_TEST)
target_compile_options(test_version PRIVATE
-Wall -Wextra -pedantic -Werror
)
endif()
endif()
set(DEBIAN_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/debian/templates")
set(DEBIAN_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/debian")

install(TARGETS helloworld_cli RUNTIME DESTINATION bin)
set(DEBIAN_TEMPLATES control changelog rules)

set(CPACK_GENERATOR DEB)
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_CONTACT example@example.com)
include(CPack)
foreach(TEMPLATE ${DEBIAN_TEMPLATES})
configure_file(
"${DEBIAN_TEMPLATE_DIR}/${TEMPLATE}"
"${DEBIAN_OUTPUT_DIR}/${TEMPLATE}"
@ONLY
)
endforeach()

if(WITH_BOOST_TEST)
enable_testing()
add_test(test_version test_version)
endif()
if(EXISTS "${DEBIAN_OUTPUT_DIR}/rules")
file(CHMOD "${DEBIAN_OUTPUT_DIR}/rules" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
build-essential \
cmake \
doxygen \
graphviz \
devscripts \
debhelper \
dos2unix \
libboost-system-dev \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /build
COPY . .

RUN doxygen Doxyfile || echo "Doxygen warnings ignored"

RUN find debian -type f -exec dos2unix {} \; || true

RUN chmod +x debian/rules

RUN dpkg-buildpackage -b -us -uc

RUN mkdir -p /output && cp /*.deb /output/

VOLUME /output
Loading