-
Notifications
You must be signed in to change notification settings - Fork 43
144 lines (129 loc) · 4.47 KB
/
build_CI_for_version1.1.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
name: Version 1.1 with Certificates
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BUILD_TYPE: Release
jobs:
format_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# If any *.c *.h *.md file(except:libspdm) have Tab, the check will fail.
- name: Check code format
run: |
if grep -rn " " * --include=*.c --include=*.h --include=*.md;
then exit 1
fi
gcc_mbedtls_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
run: |
mkdir build
cd build
cmake -E env CFLAGS="-DLIBSPDM_DEBUG_LIBSPDM_ASSERT_CONFIG=3" cmake -DARCH=x64 -DTOOLCHAIN=GCC -DTARGET=Release -DCRYPTO=mbedtls ..
make copy_sample_key
make -j`nproc`
- name: Emu_Test
run: |
cd build/bin
test_port=2323
TCPListeningnum=`netstat -an | grep ":$test_port " | awk '/^tcp.*/ && $NF == "LISTEN" {print $0}' | wc -l`
UDPListeningnum=`netstat -an | grep ":$test_port " | awk '/^udp.*/ && $NF == "0.0.0.0:*" {print $0}' | wc -l`
Listeningnum=$((TCPListeningnum + UDPListeningnum))
if [ $Listeningnum -eq 0 ]; then
echo "port is not used"
else
echo "port is used"
fi
./spdm_responder_emu --ver 1.1 &
sleep 5s
./spdm_requester_emu --ver 1.1 >requester.log
gcc_openssl_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
run: |
mkdir build
cd build
cmake -E env CFLAGS="-DLIBSPDM_DEBUG_LIBSPDM_ASSERT_CONFIG=3" cmake -DARCH=x64 -DTOOLCHAIN=GCC -DTARGET=Release -DCRYPTO=openssl ..
make copy_sample_key
make -j`nproc`
- name: Emu_Test
run: |
cd build/bin
test_port=2323
TCPListeningnum=`netstat -an | grep ":$test_port " | awk '/^tcp.*/ && $NF == "LISTEN" {print $0}' | wc -l`
UDPListeningnum=`netstat -an | grep ":$test_port " | awk '/^udp.*/ && $NF == "0.0.0.0:*" {print $0}' | wc -l`
Listeningnum=$((TCPListeningnum + UDPListeningnum))
if [ $Listeningnum -eq 0 ]; then
echo "port is not used"
else
echo "port is used"
fi
./spdm_responder_emu --ver 1.1 &
sleep 5s
./spdm_requester_emu --ver 1.1 >requester.log
VS2019_mbedtls_build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
#ilammy/msvc-dev-cmd@v1 is GitHub Action for configuring Developer Command Prompt for Microsoft Visual Studio on Windows.
#This sets up the environment for compiling C/C++ code from command line.
- name: Add msbuild to PATH
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build
run: |
mkdir build
cd build
cmake -E env CFLAGS="-DLIBSPDM_DEBUG_LIBSPDM_ASSERT_CONFIG=3" cmake -G"NMake Makefiles" -DARCH=x64 -DTOOLCHAIN=VS2019 -DTARGET=Release -DCRYPTO=mbedtls ..
nmake copy_sample_key
nmake
- name: Emu_Test
run: |
cd build/bin
./spdm_responder_emu --ver 1.1 &
sleep 5s
./spdm_requester_emu --ver 1.1
VS2019_openssl_build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
#ilammy/msvc-dev-cmd@v1 is GitHub Action for configuring Developer Command Prompt for Microsoft Visual Studio on Windows.
#This sets up the environment for compiling C/C++ code from command line.
- name: Add msbuild to PATH
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build
run: |
mkdir build
cd build
cmake -E env CFLAGS="-DLIBSPDM_DEBUG_LIBSPDM_ASSERT_CONFIG=3" cmake -G"NMake Makefiles" -DARCH=x64 -DTOOLCHAIN=VS2019 -DTARGET=Release -DCRYPTO=openssl ..
nmake copy_sample_key
nmake
- name: Emu_Test
run: |
cd build/bin
./spdm_responder_emu --ver 1.1 &
sleep 5s
./spdm_requester_emu --ver 1.1