Skip to content

Commit 3be81f2

Browse files
Added github action to test CPP API (ARM-software#187)
Github action to test C++ API
1 parent fd088ac commit 3be81f2

File tree

18 files changed

+247
-52
lines changed

18 files changed

+247
-52
lines changed

.github/workflows/runcpptest.yaml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Compile and Run
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
actions: read
11+
security-events: write
12+
13+
jobs:
14+
CI_cpp_test_run:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
# GCC currently has too many problems with the C++ API
19+
compiler: [AC6, CLANG]
20+
core: [M0, M4, M55]
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Python 3.10
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.10'
31+
cache: 'pip'
32+
cache-dependency-path: Testing/requirements.txt
33+
34+
- name: Install system packages
35+
run: |
36+
sudo add-apt-repository ppa:deadsnakes/ppa
37+
sudo apt-get install libpython3.9 libtinfo5
38+
39+
- name: Cache packs
40+
uses: actions/cache@v4
41+
with:
42+
key: packs-cmsis-dsp
43+
restore-keys: |
44+
packs-
45+
path: /home/runner/.cache/arm/packs
46+
47+
- name: Activate vcpkg
48+
uses: ARM-software/cmsis-actions/vcpkg@v1
49+
with:
50+
cache: "-cmsis_dsp_vcpkg"
51+
52+
- name: Activate Arm tool license
53+
uses: ARM-software/cmsis-actions/armlm@v1
54+
55+
- name: Cache boost
56+
id: cache-boost
57+
uses: actions/cache@v4
58+
with:
59+
key: boost-cmsis-dsp
60+
restore-keys: |
61+
boost-cmsis-dsp
62+
path: ${{ github.workspace }}/boost_1_84_0
63+
64+
- name: Install boost
65+
if: steps.cache-boost.outputs.cache-hit != 'true'
66+
run: |
67+
echo "Install boost"
68+
curl -o boost.tar.gz https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz
69+
tar -xf boost.tar.gz
70+
71+
- name: Prepare framework
72+
run: |
73+
cd dsppp
74+
echo "Create missing folders"
75+
mkdir AC6_results
76+
mkdir CLANG_results
77+
mkdir GCC_results
78+
79+
echo "Install missing python packages"
80+
pip install -r ../Testing/requirements.txt
81+
82+
echo "Load missing pack"
83+
csolution list packs -s test.csolution.yml -m > required_packs.txt
84+
85+
cat required_packs.txt
86+
cpackget add -a -f required_packs.txt
87+
88+
89+
- name: Execute
90+
run: |
91+
cd dsppp
92+
echo "Running tests"
93+
94+
python run_all.py -t -g ${{ matrix.compiler }} -c ${{ matrix.core }} -avh $AVH_FVP_PLUGINS/../bin
95+
96+
- name: Upload test report
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: test-cpp-report_${{ matrix.compiler }}_${{ matrix.core }}
100+
path: dsppp/${{ matrix.compiler }}_results/errors_${{ matrix.core }}.txt
101+
102+
103+
- name: Check error
104+
run: |
105+
cd dsppp
106+
107+
echo "Checking output..."
108+
test "$(cat ${{ matrix.compiler }}_results/errors_${{ matrix.core }}.txt | wc -l)" -eq 0

.github/workflows/runtest.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
security-events: write
1212

1313
jobs:
14-
CI_test_run:
14+
CI_c_test_run:
1515
strategy:
1616
fail-fast: false
1717
matrix:
@@ -25,17 +25,27 @@ jobs:
2525
- name: Setup Python 3.10
2626
uses: actions/setup-python@v5
2727
with:
28-
python-version: '3.10'
28+
python-version: '3.10'
29+
cache: 'pip'
30+
cache-dependency-path: Testing/requirements.txt
2931

3032
- name: Install system packages
3133
run: |
3234
sudo add-apt-repository ppa:deadsnakes/ppa
3335
sudo apt-get install libpython3.9 libtinfo5
3436
37+
- name: Cache packs
38+
uses: actions/cache@v4
39+
with:
40+
key: packs-cmsis-dsp
41+
restore-keys: |
42+
packs-
43+
path: /home/runner/.cache/arm/packs
44+
3545
- name: Activate vcpkg
3646
uses: ARM-software/cmsis-actions/vcpkg@v1
3747
with:
38-
cache: "-${{ matrix.compiler }}"
48+
cache: "-cmsis_dsp_vcpkg"
3949

4050
- name: Activate Arm tool license
4151
uses: ARM-software/cmsis-actions/armlm@v1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PythonWrapper/build_linux/Makefile
3737
PythonWrapper/build_linux/bin_dsp/
3838
PythonWrapper/build_linux/build.sh
3939
PythonWrapper/build_linux/cmake_install.cmake
40-
40+
boost_1_84_0/
4141

4242

4343
# Output of the linkchecker tool

dsppp/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ run_*.bat
1111
ac6_results/
1212
gcc_results/
1313
clang_results/
14+
AC6_results/
15+
GCC_results/
16+
CLANG_results/

dsppp/RTE/_Release_VHT-Corstone-300/RTE_Components.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CSOLUTION generated file: DO NOT EDIT!
3-
* Generated by: csolution version 2.2.1
3+
* Generated by: csolution version 2.4.0
44
*
55
* Project: 'test.Release+VHT-Corstone-300'
66
* Target: 'Release+VHT-Corstone-300'

dsppp/RTE/_Release_VHT-M0P/RTE_Components.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CSOLUTION generated file: DO NOT EDIT!
3-
* Generated by: csolution version 2.2.1
3+
* Generated by: csolution version 2.4.0
44
*
55
* Project: 'test.Release+VHT-M0P'
66
* Target: 'Release+VHT-M0P'

dsppp/RTE/_Release_VHT-M4/RTE_Components.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* CSOLUTION generated file: DO NOT EDIT!
3-
* Generated by: csolution version 2.2.1
3+
* Generated by: csolution version 2.4.0
44
*
55
* Project: 'test.Release+VHT-M4'
66
* Target: 'Release+VHT-M4'

dsppp/allocator.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "allocator.h"
22

3+
#if !defined(TESTMODE)
4+
35
#define ALLOC_POOL(BYTES,NB) \
46
MemoryPool<POOL_BLOCK_##BYTES,user_allocator_aligned_malloc> vecPool_##BYTES(NB);
57

@@ -11,11 +13,13 @@ std::map<int, int> current_stats;
1113
std::map<int, int> max_stats;
1214
std::map<void*, std::size_t> current_dyn_stats;
1315

16+
#endif
17+
1418
void print_map(std::string comment)
1519
{
1620

1721
std::cout << comment << "\r\n";
18-
#if !defined(POOL_ALLOCATOR)
22+
#if !defined(POOL_ALLOCATOR) && !defined(TESTMODE)
1923
std::size_t total_static=0;
2024
std::size_t total_dynamic=0;
2125

@@ -64,6 +68,8 @@ void print_map(std::string comment)
6468
#endif
6569
}
6670

71+
#if !defined(TESTMODE)
72+
6773
void reset_current_stats()
6874
{
6975
#if !defined(POOL_ALLOCATOR)
@@ -96,3 +102,4 @@ void check_current_stats()
96102
#endif
97103
}
98104

105+
#endif

dsppp/allocator.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88

99

1010
// Allocator for temporaries
11+
// But when in test mode (like in github action), malloc allocator is used instead
12+
#if !defined(TESTMODE)
1113
#if defined(POOL_ALLOCATOR)
1214
#define TMP_ALLOC pool_allocator
1315
#else
1416
#define TMP_ALLOC stat_allocator
1517
#endif
18+
#endif
1619

1720
#include <dsppp/memory_pool.hpp>
1821

@@ -57,6 +60,7 @@ struct pool_allocator<BYTES> {
5760
};
5861

5962

63+
#if !defined(TESTMODE)
6064
#if defined(POOL_ALLOCATOR)
6165
#include "allocation/all.h"
6266
#endif
@@ -119,6 +123,10 @@ struct stat_allocator {
119123

120124
};
121125

122-
extern void print_map(std::string comment);
123126
extern void check_current_stats();
124127
extern void reset_current_stats();
128+
129+
#endif
130+
131+
extern void print_map(std::string comment);
132+

dsppp/cdefault.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ default:
1010
- -DNDEBUG
1111
- -Wall
1212
- -Wextra
13-
- -Werror
1413
- -std=c11
1514
- -Ofast
1615
- -ffast-math
@@ -28,8 +27,6 @@ default:
2827
- -Wno-parentheses-equality
2928
- -Wno-reserved-identifier
3029
- -ffunction-sections
31-
- -Wno-nan-infinity-disabled
32-
- -DARM_MATH_LOOPUNROLL
3330
CPP:
3431
- -fno-rtti
3532
- -fno-exceptions
@@ -58,8 +55,7 @@ default:
5855
- -Wdouble-promotion
5956
- -DNDEBUG
6057
- -Wall
61-
- -Wextra
62-
- -Werror
58+
- -Wextra
6359
- -std=c11
6460
- -Ofast
6561
- -ffast-math
@@ -69,11 +65,11 @@ default:
6965
- -Wno-sign-conversion
7066
- -Wno-unused-macros
7167
- -ffunction-sections
72-
- -DARM_MATH_LOOPUNROLL
7368
- -flax-vector-conversions
7469
- -Wno-maybe-uninitialized
7570
- -fdata-sections
7671
- -fno-unroll-loops
72+
- -mfp16-format=ieee
7773
CPP:
7874
- -fno-rtti
7975
- -fno-exceptions
@@ -88,6 +84,7 @@ default:
8884
- -fdata-sections
8985
- -Wno-psabi
9086
- -fno-unroll-loops
87+
- -mfp16-format=ieee
9188
ASM:
9289
- -masm=auto
9390
Link:
@@ -106,7 +103,6 @@ default:
106103
- -DNDEBUG
107104
- -Wall
108105
- -Wextra
109-
- -Werror
110106
- -std=c11
111107
- -Ofast
112108
- -ffast-math
@@ -123,7 +119,6 @@ default:
123119
- -Wno-parentheses-equality
124120
- -Wno-reserved-identifier
125121
- -ffunction-sections
126-
- -DARM_MATH_LOOPUNROLL
127122
CPP:
128123
- -fno-rtti
129124
- -fno-exceptions

0 commit comments

Comments
 (0)