-
Notifications
You must be signed in to change notification settings - Fork 477
127 lines (110 loc) · 3.83 KB
/
cmake.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
name: CMake CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '20 4 * * 1'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
crypto: [internal, openssl, openssl3, wolfssl, nss, mbedtls]
exclude:
- os: windows-latest
crypto: openssl
- os: windows-latest
crypto: wolfssl
- os: windows-latest
crypto: openssl3
- os: windows-latest
crypto: nss
- os: windows-latest
crypto: mbedtls
- os: ubuntu-latest
crypto: openssl3
include:
- crypto: internal
cmake-crypto-enable: ""
- crypto: openssl
cmake-crypto-enable: "-DENABLE_OPENSSL=ON"
- crypto: openssl3
cmake-crypto-enable: "-DENABLE_OPENSSL=ON"
- crypto: wolfssl
cmake-crypto-enable: "-DENABLE_WOLFSSL=ON"
- crypto: nss
cmake-crypto-enable: "-DENABLE_NSS=ON"
- crypto: mbedtls
cmake-crypto-enable: "-DENABLE_MBEDTLS=ON"
runs-on: ${{ matrix.os }}
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- name: Setup Ubuntu wolfSSL
if: matrix.os == 'ubuntu-latest' && matrix.crypto == 'wolfssl'
run: |
git clone https://github.com/wolfSSL/wolfssl
cd wolfssl
git checkout v5.7.0-stable
./autogen.sh
./configure '--enable-srtp-kdf' '--enable-aesctr' '--enable-intelasm' '--enable-aesgcm-stream'
make
sudo make install
cd ..
- name: Setup Ubuntu NSS
if: matrix.os == 'ubuntu-latest' && matrix.crypto == 'nss'
run: |
sudo apt-get update
sudo apt-get install libnss3-dev
- name: Setup Ubuntu MbedTLS
if: matrix.os == 'ubuntu-latest' && matrix.crypto == 'mbedtls'
run: sudo apt-get install libmbedtls-dev
- name: Setup macOS OpenSSL
if: matrix.os == 'macos-latest' && matrix.crypto == 'openssl'
run: echo "cmake-crypto-dir=-DOPENSSL_ROOT_DIR=$(brew --prefix [email protected])" >> $GITHUB_ENV
- name: Setup macOS OpenSSL3
if: matrix.os == 'macos-latest' && matrix.crypto == 'openssl3'
run: |
brew install openssl@3
echo "cmake-crypto-dir=-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
- name: Setup macOS wolfSSL
if: matrix.os == 'macos-latest' && matrix.crypto == 'wolfssl'
run: |
brew install autoconf automake libtool
git clone https://github.com/wolfSSL/wolfssl
cd wolfssl
git checkout v5.7.0-stable
./autogen.sh
CPU=`sysctl -n machdep.cpu.brand_string`
if [[ "$CPU" =~ Intel ]]; then
./configure '--enable-srtp-kdf' '--enable-aesctr' '--enable-intelasm' '--enable-aesgcm-stream'
else
./configure '--enable-srtp-kdf' '--enable-aesctr' '--enable-armasm' '--enable-aesgcm-stream'
fi
make
sudo make install
cd ..
- name: Setup macOS NSS
if: matrix.os == 'macos-latest' && matrix.crypto == 'nss'
run: brew install nss
- name: Setup macOS MbedTLS
if: matrix.os == 'macos-latest' && matrix.crypto == 'mbedtls'
run: brew install mbedtls
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake $GITHUB_WORKSPACE -DLIBSRTP_TEST_APPS=ON ${{ matrix.cmake-crypto-enable}} ${{env.cmake-crypto-dir}}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build .
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest