Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ painter.drawLine(p1, p2);
- Use `QFileInfo` for path manipulation

## Testing Guidelines
- Build: `qmake6 PolySeg.pro && make -j4`
- Build: `mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && make -j4`
- Run: `./PolySeg`
- Test multi-polygon: Draw → Enter → Draw → Enter → Save
- Verify annotation format: Check .txt file has multiple lines

## Dependencies
- C++17 compiler
- qmake build system
- CMake 3.20+ build system
- Future: OpenCV (for AI features in Phase 7)

## Notes for AI Assistance
Expand Down Expand Up @@ -287,14 +287,14 @@ Example:
Build from the `build` directory:
```bash
cd build
qmake ../PolySeg.pro
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
```

For clean build:
```bash
cd build
make clean
qmake ../PolySeg.pro
rm -rf build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
```
109 changes: 99 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
Expand All @@ -21,21 +28,80 @@ jobs:
arch: 'linux_gcc_64'
cache: true

- name: Build
- name: Build with coverage
run: |
qmake PolySeg.pro CONFIG+=release
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
make -j$(nproc)

- name: Run tests
run: |
cd build
ctest --verbose

- name: Generate coverage report
run: |
cd build
make coverage

- name: Coverage summary
run: |
cd build
echo "## Code Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Extract overall coverage
COVERAGE_PCT=$(lcov --summary coverage_src_only.info 2>/dev/null | grep "lines" | awk '{print $2}' | head -1)
COVERAGE_LINES=$(lcov --summary coverage_src_only.info 2>/dev/null | grep "lines" | awk '{print $4"/"$6}' | head -1)
COVERAGE_FUNCS=$(lcov --summary coverage_src_only.info 2>/dev/null | grep "functions" | awk '{print $2}' | head -1)

echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Line Coverage | ${COVERAGE_PCT} |" >> $GITHUB_STEP_SUMMARY
echo "| Lines Covered | ${COVERAGE_LINES} |" >> $GITHUB_STEP_SUMMARY
echo "| Function Coverage | ${COVERAGE_FUNCS} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Simple file coverage using genhtml output
echo "### Coverage by File" >> $GITHUB_STEP_SUMMARY
echo "| File | Lines | Coverage |" >> $GITHUB_STEP_SUMMARY
echo "|------|-------|----------|" >> $GITHUB_STEP_SUMMARY

# Extract file coverage from genhtml verbose output
genhtml coverage_src_only.info --quiet --output-directory /tmp/cov_temp 2>&1 | \
grep "Processing file" | \
sed 's/Processing file //' | \
grep "src/" | \
head -10 | \
while read line; do
file=$(echo "$line" | cut -d' ' -f1)
echo "| \`$file\` | - | - |" >> $GITHUB_STEP_SUMMARY
done

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: build/coverage_src_only.info
fail_ci_if_error: false

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: build/coverage_html/

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PolySeg-linux
path: PolySeg
path: build/PolySeg

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
Expand All @@ -51,19 +117,28 @@ jobs:

- name: Build
run: |
qmake PolySeg.pro CONFIG+=release
nmake
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release

- name: Run tests
run: |
cd build
ctest -C Release --verbose

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PolySeg-windows
path: release/PolySeg.exe
path: build/Release/PolySeg.exe

build-macos-intel:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
Expand All @@ -76,19 +151,27 @@ jobs:

- name: Build
run: |
qmake PolySeg.pro CONFIG+=release
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.ncpu)

- name: Run tests
run: |
cd build
ctest --verbose

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PolySeg-macos-intel
path: PolySeg.app
path: build/PolySeg.app

build-macos-arm:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
Expand All @@ -101,11 +184,17 @@ jobs:

- name: Build
run: |
qmake PolySeg.pro CONFIG+=release
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.ncpu)

- name: Run tests
run: |
cd build
ctest --verbose

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PolySeg-macos-arm
path: PolySeg.app
path: build/PolySeg.app
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ PolySeg
# OS
.DS_Store
Thumbs.db

# Internal documentation and planning files
docs/*-plan.md
docs/*-specification.md
docs/*-implementation*.md
docs/internal-*
docs/planning-*
*.coverage-baseline
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/googletest"]
path = external/googletest
url = https://github.com/google/googletest.git
Loading
Loading