Skip to content

Commit bbe6390

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

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/ut.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
output: test-summary.md
38+
if: always()
39+
40+
- name: Upload test summary
41+
uses: actions/upload-artifact@v3
42+
with:
43+
name: test-summary
44+
path: test-summary.md
45+
if: always()

0 commit comments

Comments
 (0)