-
Notifications
You must be signed in to change notification settings - Fork 24
130 lines (108 loc) · 3.87 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
name: CI
on: [push, pull_request]
jobs:
main:
strategy:
fail-fast: false
matrix:
c-compiler: [gcc, clang]
config:
# OpenSSL 1.1.1 (Ubuntu 20.04)
- os-image: ubuntu-latest
container: ubuntu:20.04
crypto-provider: OpenSSL
# OpenSSL 3.0 (Ubuntu 22.04)
- os-image: ubuntu-latest
container: ubuntu:22.04
crypto-provider: OpenSSL
- os-image: ubuntu-latest
container: ubuntu:20.04
crypto-provider: MbedTLS
crypto-provider-version: 'v2.28.0'
crypto-provider-extra: ''
crypto-provider-build-extra: ''
- os-image: ubuntu-latest
container: ubuntu:20.04
crypto-provider: MbedTLS
crypto-provider-version: 'v3.1.0'
crypto-provider-extra: ''
crypto-provider-build-extra: ''
- os-image: ubuntu-latest
container: ubuntu:20.04
crypto-provider: MbedTLS
crypto-provider-version: 'v3.4.0'
crypto-provider-extra: ''
crypto-provider-build-extra: ''
- os-image: ubuntu-latest
container: ubuntu:20.04
crypto-provider: MbedTLS
crypto-provider-version: 'v3.4.0'
crypto-provider-extra: ''
crypto-provider-build-extra: 'python3 scripts/config.py set MBEDTLS_ECP_RESTARTABLE'
- os-image: ubuntu-latest
container: ubuntu:20.04
crypto-provider: Test
name: ${{ matrix.config.crypto-provider }} ${{ matrix.config.crypto-provider-version }} • ${{ matrix.c-compiler }} • ${{ matrix.config.container }}
runs-on: ${{ matrix.config.os-image }}
container: ${{ matrix.config.container }}
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
set -ex
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y build-essential cmake python3 ${{ matrix.c-compiler }} \
python3-jinja2 python3-jsonschema
echo "CC=${{ matrix.c-compiler }}" >> $GITHUB_ENV
- name: Install OpenSSL
if: matrix.config.crypto-provider == 'OpenSSL'
run: apt-get install -y libssl-dev
- name: Fetch MbedTLS
if: matrix.config.crypto-provider == 'MbedTLS'
uses: actions/checkout@v3
with:
repository: ARMmbed/mbedtls
ref: ${{ matrix.config.crypto-provider-version }}
path: mbedtls
- name: Install MbedTLS
if: matrix.config.crypto-provider == 'MbedTLS'
run: |
cd mbedtls
${{ matrix.config.crypto-provider-build-extra }}
make -j $(nproc)
make install
- name: Fetch QCBOR
uses: actions/checkout@v3
with:
repository: laurencelundblade/QCBOR
path: QCBOR
- name: Install QCBOR
run: |
cd QCBOR
make -j$(nproc)
make install
- name: Build t_cose
run: |
set -ex
mkdir build
cd build
cmake -DCRYPTO_PROVIDER=${{ matrix.config.crypto-provider }} \
${{ matrix.config.crypto-provider-extra }} \
${{ matrix.config.defines }} \
..
make -j $(nproc)
- name: Run examples
run: build/t_cose_examples
- name: Run tests
if: matrix.config.crypto-provider == 'MbedTLS' &&
matrix.config.crypto-provider-version == 'v3.4.0' &&
matrix.config.crypto-provider-build-extra == ''
# This Mbed TLS version has the option of restartable ECP, however it is
# not turned on. In this case the restartable testcase should fail.
run: build/t_cose_test | grep 'restart_test_2_step FAILED'
- name: Run tests
if: ${{ ! ( matrix.config.crypto-provider == 'MbedTLS' &&
matrix.config.crypto-provider-version == 'v3.4.0' &&
matrix.config.crypto-provider-build-extra == '' ) }}
run: build/t_cose_test