-
Notifications
You must be signed in to change notification settings - Fork 60
242 lines (220 loc) · 7.54 KB
/
build.yml
File metadata and controls
242 lines (220 loc) · 7.54 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: CryptoLib
on:
pull_request:
branches: [ main, dev ]
jobs:
#
# Minimal Build
#
minimal_build:
# Container Setup
runs-on: ubuntu-latest
container:
image: ivvitc/cryptolib:20250108
steps:
- uses: actions/checkout@v4
- name: Update
run: apt-get update
- name: Install Dependencies
run: apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3
# End Container Setup
- name: Minimal Build Script
working-directory: ${{github.workspace}}
run: bash ${GITHUB_WORKSPACE}/support/scripts/build_minimal.sh
#
# Internal Build
#
internal_build:
# Container Setup
runs-on: ubuntu-latest
container:
image: ivvitc/cryptolib:20250108
steps:
- uses: actions/checkout@v4
- name: Update
run: apt-get update
- name: Install Dependencies
run: apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3
# End Container Setup
- name: Internal Build Script
working-directory: ${{github.workspace}}
run: |
export CFLAGS="-fprofile-arcs -ftest-coverage -fcondition-coverage -g"
bash ${GITHUB_WORKSPACE}/support/scripts/build_internal.sh
# - name: Code-Coverage
# working-directory: ${{github.workspace}}
# run: make gcov
- name: Upload
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: 'coverage/*.c.gcov'
verbose: true
#
# KMC Build
#
kmc_build:
# Container Setup
runs-on: ubuntu-latest
container:
image: ivvitc/cryptolib:20250108
steps:
- uses: actions/checkout@v4
with:
repository: NASA-AMMOS/DCS
path: DCS
submodules: recursive
ref: dev
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set current branch
run: echo "BRANCH_NAME=$(echo ${{ github.head_ref || github.ref_name }})" >> $GITHUB_ENV
- name: Update
run: apt-get update
- name: Install Dependencies
run: apt-get install -y libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3 openjdk-17-jdk openjdk-17-jre cmake swig maven podman default-jdk
- name: Install Python Libraries
run: |
pip3 install --break-system-packages pycryptodome cffi invoke
- name: update Cryptolib
run: |
cd DCS/ammos-cryptolib
rm -rf CryptoLib
git clone --single-branch --branch $BRANCH_NAME https://github.com/nasa/CryptoLib.git
- name: add required jars
run: |
cd DCS/ammos-cryptolib/kmc_sdls/kmc_sdls_java/kmc_sdls_java_test
curl -LS https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar -o ./junit-4.13.2.jar
curl -LS https://repo1.maven.org/maven2/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar -o ./hamcrest-2.2.jar
- name: build DCS
run: |
cd ./DCS
export JAVA_HOME=/lib/jvm/java-17-openjdk-amd64
./kmc-resources/scripts/build.sh
#
# Wolf Build
#
wolf_build:
# Container Setup
runs-on: ubuntu-latest
container:
image: ivvitc/cryptolib:20250108
steps:
- uses: actions/checkout@v4
- name: Update
run: apt-get update
- name: Install Dependencies
run: apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3 autoconf libtool
- name: Clone WolfSSL
run: git clone --depth 1 --branch v5.6.0-stable https://github.com/wolfSSL/wolfssl.git /tmp/wolfssl
# cmake -DCMAKE_INSTALL_PREFIX=/home/runner/.local -DWOLFSSL_AESCCM=yes -DWOLFSSL_AESSIV=yes -DWOLFSSL_CMAC=yes ..;
- name: Build WolfSSL
# -DCMAKE_INSTALL_PREFIX=/home/runner/.local
#run: cd /tmp/wolfssl/;
# sudo chown -R runner /usr/local;
# ./autogen.sh;
# sudo ./configure --enable-aesccm --enable-aessiv --enable-cmac;
# make;
# make install;
#sudo chown -R runner /usr/local;
run: mkdir /tmp/wolfssl/build;
cd /tmp/wolfssl/build;
cmake -DWOLFSSL_AESCCM=yes -DWOLFSSL_AESSIV=yes -DWOLFSSL_CMAC=yes ..;
cmake --build .;
make install;
ldconfig;
# End Container Setup
- name: Wolf Build Script
working-directory: ${{github.workspace}}
run: |
export CFLAGS="-fprofile-arcs -ftest-coverage -fcondition-coverage -g"
bash ${GITHUB_WORKSPACE}/support/scripts/build_wolf.sh
# - name: Code-Coverage
# working-directory: ${{github.workspace}}
# run: make gcov
- name: Upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: 'coverage/*.c.gcov'
verbose: true
#
# RHEL Build
#
rhel_build:
# Container Setup
runs-on: ubuntu-latest
container:
image: rockylinux/rockylinux:9
steps:
- uses: actions/checkout@v4
- name: Update
run: yum update -y
- name: Install Dependencies
run: yum install -y --enablerepo=devel python3-pip python3-devel epel-release libcurl-devel git cmake gcc java-11-openjdk-devel openssl wget bzip2 ldconfig mariadb-devel mariadb-common mariadb-connector-c mariadb-connector-c-config mariadb-errmsg mariadb-gssapi-server libasan
# Might want to trim this down, but these dependencies should work for KMC
- name: install lcov
run: yum install -y --enablerepo=epel lcov
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& ./configure
&& make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& ./configure
&& make install
&& echo "export LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/include:$LD_LIBRARY_PATH" >> ~/.bashrc
&& source ~/.bashrc
&& ldconfig
# End Container Setup
- name: RHEL Build Script
working-directory: ${{github.workspace}}
run: source ~/.bashrc && ${GITHUB_WORKSPACE}/support/scripts/build_rhel.sh
- name: Code-Coverage
working-directory: ${{github.workspace}}
run: source ~/.bashrc && make gcov
- name: Upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: 'coverage/*.c.gcov'
verbose: true
#
# Ext. Proc. Build
#
EP_build:
# Container Setup
runs-on: ubuntu-latest
container:
image: ivvitc/cryptolib:20250108
steps:
- uses: actions/checkout@v4
- name: Update
run: apt-get update
- name: Install Dependencies
run: apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3
# End Container Setup
- name: Internal Build Script
working-directory: ${{github.workspace}}
run: |
export CFLAGS="-fprofile-arcs -ftest-coverage -fcondition-coverage -g"
bash ${GITHUB_WORKSPACE}/support/scripts/build_ep.sh
# - name: Code-Coverage
# working-directory: ${{github.workspace}}
# run: make gcov
- name: Upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: 'coverage/*.c.gcov'
verbose: true