Skip to content

test

test #147

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
[push, pull_request, workflow_call]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs a single command using the runners shell
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libeigen3-dev
- name: Build
run: mkdir build && cd build && cmake .. && cmake --build .
test:
needs: build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libeigen3-dev
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Build
run: mkdir build && cd build && cmake .. && cmake --build .
- name: Test
run: cd ./build && make test
- name: Check code coverage
run: /usr/bin/lcov --directory ./build --capture --output-file ./build/coverage.info && /usr/bin/lcov --remove ./build/coverage.info "/usr/*" "*/googletest/googletest/*" --output-file ./build/coverage.info
- name: List coverage summary
run: /usr/bin/lcov --list ./build/coverage.info
- name: Upload report to codecov
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -f ./build/coverage.info
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: package
path: build/
- name: Download artifacts
uses: actions/download-artifact@v4