From a0bce1895278383d10955326a6c02d28fea12c10 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 14:29:28 +0000 Subject: [PATCH 1/2] Initial plan From 9065de298a3bb299bbcba2bd9cdc59ed021f81e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 14:32:50 +0000 Subject: [PATCH 2/2] Add GitHub Actions workflows for build/test and code coverage Co-authored-by: divinepablo <87882202+divinepablo@users.noreply.github.com> --- .github/workflows/build-and-test.yml | 30 ++++++++++++++++ .github/workflows/coverage.yml | 52 ++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..d00ed1c --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,30 @@ +name: Build and Test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build-test: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake ninja-build + + - name: Configure + run: cmake --preset default + + - name: Build + run: cmake --build --preset default + + - name: Run tests + run: ctest --test-dir build --output-on-failure diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..53e7a1b --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,52 @@ +name: Code Coverage + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + coverage: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake ninja-build lcov + + - name: Configure with coverage flags + run: | + cmake -B build \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_FLAGS="--coverage" \ + -DCMAKE_C_FLAGS="--coverage" \ + -DCMAKE_EXE_LINKER_FLAGS="--coverage" + + - name: Build + run: cmake --build build + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + - name: Generate coverage report + run: | + lcov --directory build --capture --output-file coverage.info + lcov --remove coverage.info \ + '/usr/*' \ + '*/googletest/*' \ + '*/vremu6502/*' \ + '*/tests/*' \ + --output-file coverage.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./coverage.info + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false