Skip to content

Commit

Permalink
CI: move coverage to its own workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Jan 25, 2025
1 parent d19e9d0 commit 2f9734b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,3 @@ jobs:
run: cmake --build build/${{ matrix.preset }} -j8
- name: Run tests
run: ctest --test-dir build/${{ matrix.preset }} --output-on-failure --no-tests=error -j8

linux-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y g++-14
wget https://github.com/linux-test-project/lcov/releases/download/v2.3/lcov-2.3.tar.gz
tar -xvf lcov-2.3.tar.gz
cd lcov-2.3
sudo make install
sudo cpan App::cpanminus
sudo cpanm --notest Capture::Tiny DateTime
- name: Configure
run: cmake --preset=ci-coverage
- name: Build
run: cmake --build build/ci-coverage -j8
- name: Run tests
run: ctest --test-dir build/ci-coverage --output-on-failure --no-tests=error -j8
- name: Process coverage info
run: cmake --build build/ci-coverage -t coverage
- name: Submit to codecov.io
uses: codecov/codecov-action@v5
with:
files: build/ci-coverage/coverage.info
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
42 changes: 42 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Coverage

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
linux-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y g++-14
wget https://github.com/linux-test-project/lcov/releases/download/v2.3/lcov-2.3.tar.gz
tar -xvf lcov-2.3.tar.gz
cd lcov-2.3
sudo make install
sudo cpan App::cpanminus
sudo cpanm --notest Capture::Tiny DateTime
- name: Configure
run: cmake --preset=ci-coverage
- name: Build
run: cmake --build build/ci-coverage -j8
- name: Run tests
run: ctest --test-dir build/ci-coverage --output-on-failure --no-tests=error -j8
- name: Process coverage info
run: cmake --build build/ci-coverage -t coverage
- name: Submit to codecov.io
uses: codecov/codecov-action@v5
with:
files: build/ci-coverage/coverage.info
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

0 comments on commit 2f9734b

Please sign in to comment.