Skip to content

add examples for calculating parameter lengths #367

add examples for calculating parameter lengths

add examples for calculating parameter lengths #367

# Gets the GoogleTest code coverage metrics.
name: get-gtest-codecov
on:
pull_request:
branches:
- dev
- main
push:
branches:
- dev
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Ninja
run: sudo apt-get install ninja-build
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::remotes
- name: install local version of FIMS
run: remotes::install_local(upgrade= "always", force = TRUE)
shell: Rscript {0}
- name: setup for gtest
run: FIMS:::setup_gtest()
shell: Rscript {0}
#note: the following configure, build and test steps could instead
# be run from r using FIMS::setup_and_run_gtest()
- name: Configure
# Do not run -DBUILD_DOC=OFF locally. Only run cmake -S . -B build -G Ninja locally.
run: |
cmake -S . -B build -DBUILD_DOC=OFF -G Ninja
- name: Build
run: |
cmake --build build --parallel 16
- name: Test
run: |
ctest --test-dir build --parallel 16
- name: Install gcovr
run: |
pip install gcovr
- name: Run gcovr
run: |
gcovr --exclude tests/ --cobertura coverage.xml
- name: save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}