-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (132 loc) · 4.61 KB
/
ci.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: SPDM-Utils-ci
on:
push:
pull_request:
jobs:
ci-check:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
components: rustfmt, clippy
- name: Install dependencies
run: |
sudo apt-get update; \
sudo apt-get install -y cmake libclang-dev libpci-dev libssl-dev python3-dev gem; \
sudo gem install cbor-diag;
- name: Build libspdm
run: |
pushd third-party/libspdm; \
mkdir build; cd build; \
cmake \
-DARCH=x64 \
-DTOOLCHAIN=GCC \
-DTARGET=Debug \
-DCRYPTO=openssl \
-DENABLE_BINARY_BUILD=1 \
-DCOMPILED_LIBCRYPTO_PATH=/usr/lib/ \
-DCOMPILED_LIBSSL_PATH=/usr/lib/ \
-DDISABLE_TESTS=1 \
-DCMAKE_C_FLAGS=" \
-DLIBSPDM_ENABLE_CAPABILITY_EVENT_CAP=0 \
-DLIBSPDM_ENABLE_CAPABILITY_MEL_CAP=0 \
-DLIBSPDM_HAL_PASS_SPDM_CONTEXT=1 \
-DLIBSPDM_ENABLE_CAPABILITY_GET_KEY_PAIR_INFO_CAP=0 \
-DLIBSPDM_ENABLE_CAPABILITY_SET_KEY_PAIR_INFO_CAP=0 \
" \
.. ; \
make -j8; \
popd;
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Test
run: |
cargo test; \
./target/debug/spdm_utils --socket-server response & \
sleep 1; \
./target/debug/spdm_utils --socket-client tests;
# TODO: Fixup clippy failures and enable this
# - name: Clippy
# uses: actions-rs/cargo@v1
# with:
# command: clippy
- name: Format Tock Responder
run: pushd tock-responder && cargo fmt --all -- --check && popd
- name: Install ARM toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: latest
- name: Install elf2tab
run: cargo install elf2tab
- name: Build ARM embedded libspdm
run: |
pushd third-party/libspdm; \
mkdir -p build_no_std_arm; \
cd build_no_std_arm; \
find \
../os_stub/mbedtlslib/include/mbedtls/libspdm_mbedtls_config.h \
-type f -exec \
sed -i 's|#define MBEDTLS_HAVE_TIME_DATE|// #define MBEDTLS_HAVE_TIME_DATE|g' {} + ; \
cmake \
-DARCH=arm \
-DTOOLCHAIN=ARM_GNU_BARE_METAL \
-DTARGET=Release \
-DCRYPTO=mbedtls \
-DDISABLE_TESTS=1 \
-DMARCH=armv7e-m \
-DDISABLE_LTO=1 \
-DCMAKE_C_FLAGS=" \
-DMBEDTLS_SKIP_TIME_CHECK \
-DLIBSPDM_ENABLE_CAPABILITY_EVENT_CAP=0 \
-DLIBSPDM_ENABLE_CAPABILITY_MEL_CAP=0 \
-DLIBSPDM_HAL_PASS_SPDM_CONTEXT=1 \
-DLIBSPDM_ENABLE_CAPABILITY_GET_KEY_PAIR_INFO_CAP=0 \
-DLIBSPDM_ENABLE_CAPABILITY_SET_KEY_PAIR_INFO_CAP=0 \
-DMBEDTLS_PLATFORM_MS_TIME_ALT \
" \
.. ; \
make -j8; \
popd;
- name: Build Tock Responder for nRF52840
run: pushd tock-responder && make nrf52840_spdm_responder && popd
# Ubuntu uses riscv64-unknown-elf-gcc, which isn't supported by
# the libspdm CMake TOOLCHAIN
# - name: Install RISC-V toolchain
# run: |
# sudo apt-get install -y gcc-riscv64-unknown-elf
# - name: Build RISC-V embedded libspdm
# run: |
# pushd third-party/libspdm; \
# mkdir -p build_no_std_riscv; \
# cd build_no_std_riscv; \
# cmake \
# -DARCH=riscv32 \
# -DTOOLCHAIN=RISCV_NONE \
# -DTARGET=Release \
# -DCRYPTO=mbedtls \
# -DDISABLE_TESTS=1 \
# -DCMAKE_C_FLAGS=" \
# -DMBEDTLS_SKIP_TIME_CHECK \
# -DLIBSPDM_ENABLE_CAPABILITY_EVENT_CAP=0 \
# -DLIBSPDM_ENABLE_CAPABILITY_MEL_CAP=0 \
# " \
# .. ; \
# make -j8; \
# popd;
# - name: Build Tock Responder for OpenTitan
# run: pushd tock-responder && make opentitan_spdm_responder && popd