forked from wolfSSL/wolfBoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-external-library-paths.yml
More file actions
90 lines (75 loc) · 2.97 KB
/
test-external-library-paths.yml
File metadata and controls
90 lines (75 loc) · 2.97 KB
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
81
82
83
84
85
86
87
88
89
90
name: Test External Library Paths
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
jobs:
test_external_libs:
runs-on: ubuntu-latest
timeout-minutes: 15
# Matrix to test multiple configurations
strategy:
matrix:
test-config:
- name: "External wolfSSL"
config: "config/examples/sim.config"
- name: "External wolfTPM"
config: "config/examples/sim-tpm.config"
build-tpm-tools: true
- name: "external wolfHSM"
config: "config/examples/sim-wolfHSM-client-ecc.config"
- name: "Unit tests"
config: ""
is-unit-test: true
fail-fast: false
steps:
# Checkout wolfBoot with submodules
- uses: actions/checkout@v4
with:
submodules: true
# Move libraries outside the wolfBoot tree
- name: Relocate libraries to external path
run: |
echo "=== Moving libraries outside wolfBoot tree ==="
mv lib ../external-libs
ls -la ../external-libs/
echo "Libraries moved to ../external-libs"
# Select configuration (skip for unit tests)
- name: Select config
if: matrix.test-config.config != ''
run: |
cp ${{ matrix.test-config.config }} .config
echo "=== Selected config: ${{ matrix.test-config.name }} ==="
# Build TPM tools if needed
- name: Build TPM tools with external paths
if: matrix.test-config.build-tpm-tools == true
run: |
echo "=== Building TPM tools with external paths ==="
make tpmtools \
WOLFBOOT_LIB_WOLFSSL=$(realpath ../external-libs/wolfssl) \
WOLFBOOT_LIB_WOLFTPM=$(realpath ../external-libs/wolfTPM)
# Build main target (skip for unit tests)
- name: Build wolfBoot with external library paths
if: matrix.test-config.is-unit-test != true
run: |
echo "=== Building wolfBoot with external paths ==="
make clean
make \
WOLFBOOT_LIB_WOLFSSL="$(realpath ../external-libs/wolfssl)" \
WOLFBOOT_LIB_WOLFTPM="$(realpath ../external-libs/wolfTPM)" \
WOLFBOOT_LIB_WOLFPKCS11="$(realpath ../external-libs/wolfPKCS11)" \
WOLFBOOT_LIB_WOLFHSM="$(realpath ../external-libs/wolfHSM)"
# If building unit tests, install libcheck
- name: install libcheck
if: matrix.test-config.is-unit-test == true
run: sudo apt-get install --no-install-recommends -y -q check
# Build unit tests with external paths
- name: Build unit tests with external library paths
if: matrix.test-config.is-unit-test == true
run: |
echo "=== Building unit tests with external paths ==="
make -C tools/unit-tests \
WOLFBOOT_LIB_WOLFSSL="$(realpath ../external-libs/wolfssl)" \
WOLFBOOT_LIB_WOLFPKCS11="$(realpath ../external-libs/wolfPKCS11)"