-
Notifications
You must be signed in to change notification settings - Fork 10
80 lines (66 loc) · 2.48 KB
/
ci_uicc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI/CD for UICC Project
on:
push:
branches:
- "**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
verify-c-structs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Generate C Structs
run: |
cd utils/files-c-array
python3 toCArray.py
- name: Restore c-structs and verify their identity of restored with original files
run: |
set -e
git add .
git diff --cached --exit-code --ignore-space-at-eol
uicc-build-and-test:
runs-on: ubuntu-20.04
timeout-minutes: 15
strategy:
matrix:
flags: ["", "-DCONFIG_EXTERNAL_KEY_LOAD=y", "-DCONFIG_USE_UTILS=y", "-DCONFIG_BUILD_LIB_ONLY=y"]
compiler: [gcc, clang]
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.27.0
ninjaVersion: 1.11.1
- name: Install Embedded Toolchain
uses: carlosperate/[email protected]
if: matrix.compiler == 'gcc'
- name: Install CLANG
run: |
sudo apt-get update
sudo apt-get install -y clang
if: matrix.compiler == 'clang'
- name: Add key loaders to tests
run: |
echo "void ss_load_key_external(const uint8_t *key_id, size_t in_len, uint8_t *key, size_t *key_len){memcpy(key, key_id, in_len);*key_len = in_len;}" >> src/softsim/main.c
echo "void ss_load_key_external(const uint8_t *key_id, size_t in_len, uint8_t *key, size_t *key_len){memcpy(key, key_id, in_len);*key_len = in_len;}" >> tests/ota/ota_test.c
echo "void ss_load_key_external(const uint8_t *key_id, size_t in_len, uint8_t *key, size_t *key_len){memcpy(key, key_id, in_len);*key_len = in_len;}" >> tests/aes/aes_test.c
if: matrix.flags == '-DCONFIG_EXTERNAL_KEY_LOAD=y'
- name: Configure and Build Project
run: |
cmake -S . -B build -DBUILD_TESTING=y -DCONFIG_USE_SYSTEM_HEAP=y -DCONFIG_ENABLE_SANITIZE=y ${{ matrix.flags }}
cmake --build build
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}++
- name: Test Project
run: cd build && ctest --output-on-failure