Skip to content

Commit e061fa9

Browse files
committed
Работа с Базой Данных из Qt
0 parents  commit e061fa9

4 files changed

Lines changed: 130 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install tools
23+
run: sudo apt-get update && sudo apt-get install -y lcov g++ qt5-qmake qtbase5-dev qtchooser 2>/dev/null || true
24+
25+
- name: Build
26+
run: |
27+
PRO_FILE=$(find . -maxdepth 2 -name "*.pro" | head -1)
28+
if [ -n "$PRO_FILE" ]; then
29+
echo "Building with qmake: $PRO_FILE"
30+
qmake "$PRO_FILE" "QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage" "QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage" && make -j$(nproc) || true
31+
elif [ -f CMakeLists.txt ]; then
32+
echo "Building with CMake"
33+
cmake -B build -DCMAKE_CXX_FLAGS="--coverage" && cmake --build build || true
34+
elif [ -f Makefile ]; then
35+
echo "Building with Makefile"
36+
make || true
37+
else
38+
echo "Compiling C++ files directly"
39+
find . -name "*.cpp" -not -path "./build/*" | head -20 | xargs g++ -fprofile-arcs -ftest-coverage -o /dev/null 2>&1 || true
40+
fi
41+
42+
- name: Run tests
43+
run: make check 2>/dev/null || ctest 2>/dev/null || true
44+
45+
- name: Coverage report
46+
if: always()
47+
run: |
48+
lcov --capture --directory . --output-file coverage.info --ignore-errors source 2>/dev/null || true
49+
if [ -f coverage.info ] && [ -s coverage.info ]; then
50+
lcov --remove coverage.info '/usr/*' '*/moc_*' '*/ui_*' --output-file coverage.info 2>/dev/null || true
51+
echo "## Test Coverage Report" >> $GITHUB_STEP_SUMMARY
52+
echo '```' >> $GITHUB_STEP_SUMMARY
53+
lcov --summary coverage.info 2>&1 | grep -E "lines|functions" >> $GITHUB_STEP_SUMMARY || echo "No data" >> $GITHUB_STEP_SUMMARY
54+
echo '```' >> $GITHUB_STEP_SUMMARY
55+
else
56+
echo "## Code Inventory" >> $GITHUB_STEP_SUMMARY
57+
echo '```' >> $GITHUB_STEP_SUMMARY
58+
echo "C++ files: $(find . -name '*.cpp' -o -name '*.h' | wc -l)" >> $GITHUB_STEP_SUMMARY
59+
find . -name '*.cpp' -o -name '*.h' | xargs wc -l 2>/dev/null | tail -1 >> $GITHUB_STEP_SUMMARY
60+
echo '```' >> $GITHUB_STEP_SUMMARY
61+
fi

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# C++ objects and libs
2+
3+
*.slo
4+
*.lo
5+
*.o
6+
*.a
7+
*.la
8+
*.lai
9+
*.so
10+
*.dll
11+
*.dylib
12+
13+
# Qt-es
14+
15+
/.qmake.cache
16+
/.qmake.stash
17+
*.pro.user
18+
*.pro.user.*
19+
*.qbs.user
20+
*.qbs.user.*
21+
*.moc
22+
moc_*.cpp
23+
qrc_*.cpp
24+
ui_*.h
25+
Makefile*
26+
*build-*
27+
28+
# QtCreator
29+
30+
*.autosave
31+
32+
#QtCtreator Qml
33+
*.qmlproject.user
34+
*.qmlproject.user.*
35+
.idea

CLAUDE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Qt_SQLBrowser — Работа с Базой Данных из Qt
2+
3+
## About
4+
5+
Qt desktop application demonstrating widgets, signals/slots, and cross-platform GUI development.
6+
7+
## Prerequisites
8+
9+
- See project documentation
10+
11+
## Build & Run
12+
13+
```bash
14+
# See project files for build instructions
15+
```
16+
17+
## Development Guidelines
18+
19+
### Code Style
20+
- Follow standard unknown conventions
21+
- Keep code clean and well-organized
22+
- Use meaningful variable and method names
23+
24+
### Git Workflow
25+
- Write clear, descriptive commit messages
26+
- One logical change per commit
27+
- Test before committing
28+
29+
### Testing
30+
- Write tests for new functionality
31+
- Run the full test suite before pushing
32+
- Keep tests focused and independent

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Qt_SQLBrowser
2+
Работа с Базой Данных из Qt

0 commit comments

Comments
 (0)