Skip to content

Commit a92b2f0

Browse files
ci: add a workflow to run unit tests
Signed-off-by: Cedric CHEDALEUX <cedric.chedaleux@orange.com>
1 parent 5bea3dc commit a92b2f0

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/ut.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y cmake build-essential
20+
21+
- name: Configure CMake
22+
run: |
23+
cmake -Bbuild -DTEST_ENABLED=ON -DSAMPLE_ENABLED=ON .
24+
25+
- name: Build project
26+
run: |
27+
cmake --build build
28+
29+
- name: Run unit tests
30+
run: |
31+
./build/tests/uprof-tests --reporter JUnit::out=test-results.xml --reporter console::out=-::colour-mode=ansi --success
32+
33+
- name: Upload JUnit report
34+
uses: test-summary/action@v2
35+
with:
36+
paths: "test-results.xml"
37+
if: always()

0 commit comments

Comments
 (0)