Skip to content

ci: add a workflow to run unit tests #6

ci: add a workflow to run unit tests

ci: add a workflow to run unit tests #6

Workflow file for this run

name: Unit tests
on:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Configure CMake
run: |
cmake -Bbuild -DTEST_ENABLED=ON -DSAMPLE_ENABLED=ON .
- name: Build project
run: |
cmake --build build
- name: Run unit tests
run: |
./build/tests/uprof-tests --reporter JUnit::out=test-results.xml --reporter console::out=-::colour-mode=ansi --success
- name: Upload JUnit report
uses: test-summary/action@v2
with:
paths: "test-results.xml"
output: test-summary.md
if: always()
- name: Upload test summary
uses: actions/upload-artifact@v3
with:
name: test-summary
path: test-summary.md
if: always()