Skip to content

Add Continuous Integration with Multiple Platforms#12

Description

@mseminatore

Issue: Add Continuous Integration with Multiple Platforms

Priority

馃煛 Medium

Description

While GitHub Actions badge exists in README, it's unclear if CI is fully configured. Need comprehensive CI that:

  • Tests on Windows, Linux, macOS
  • Runs both debug and release builds
  • Checks for memory leaks and undefined behavior
  • Enforces code quality standards
  • Reports test coverage

Proposed Implementation

  1. Create .github/workflows/ci.yml:

    name: CI
    
    on: [push, pull_request]
    
    jobs:
      build:
        strategy:
          matrix:
            os: [ubuntu-latest, windows-latest, macos-latest]
            build_type: [Debug, Release]
        
        runs-on: ${{ matrix.os }}
        
        steps:
          - uses: actions/checkout@v4
            with:
              submodules: recursive
          
          - name: Configure CMake
            run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
          
          - name: Build
            run: cmake --build build
          
          - name: Test
            run: ctest --test-dir build --output-on-failure
  2. Add sanitizer job (Linux only):

      sanitize:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
            with:
              submodules: recursive
          
          - name: Configure with sanitizers
            run: |
              cmake -B build \
                -DCMAKE_BUILD_TYPE=Debug \
                -DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer"
          
          - name: Build
            run: cmake --build build
          
          - name: Test
            run: ctest --test-dir build --output-on-failure
  3. Add code coverage job:

      coverage:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
            with:
              submodules: recursive
          
          - name: Install lcov
            run: sudo apt-get install -y lcov
          
          - name: Configure
            run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
          
          - name: Build and test
            run: |
              cmake --build build
              ctest --test-dir build
          
          - name: Generate coverage
            run: |
              lcov --capture --directory build --output-file coverage.info
              lcov --remove coverage.info '/usr/*' --output-file coverage.info
          
          - name: Upload to Codecov
            uses: codecov/codecov-action@v3
  4. Add status badges to README.md:

    ![CI Status](https://github.com/USER/skeme/workflows/CI/badge.svg)
    ![Coverage](https://codecov.io/gh/USER/skeme/branch/main/graph/badge.svg)

Testing & Acceptance Criteria

  • CI runs on push to main branch
  • CI runs on all pull requests
  • Tests pass on Ubuntu, Windows, macOS
  • Both Debug and Release builds tested
  • AddressSanitizer detects no memory errors
  • UndefinedBehaviorSanitizer detects no UB
  • Code coverage report generated and uploaded
  • Build status badge shows in README
  • Failed builds block PR merging
  • CI completes in <5 minutes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions