Skip to content

Commit edb5d09

Browse files
committed
Add rng-tools action
1 parent 1b8254d commit edb5d09

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

.github/workflows/rng-tools.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: rng-tools Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfssl:
17+
name: Build wolfSSL
18+
# Just to keep it the same as the testing target
19+
runs-on: ubuntu-latest
20+
# This should be a safe limit for the tests to run.
21+
timeout-minutes: 4
22+
steps:
23+
- name: Build wolfSSL
24+
uses: wolfSSL/actions-build-autotools-project@v1
25+
with:
26+
path: wolfssl
27+
configure: --enable-all
28+
install: true
29+
check: false
30+
31+
- name: Upload built lib
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: wolf-install-rng-tools
35+
path: build-dir
36+
retention-days: 5
37+
38+
rng-tools_check:
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
# List of releases to test
43+
ref: [ 6.16 ]
44+
name: ${{ matrix.ref }}
45+
runs-on: ubuntu-latest
46+
# This should be a safe limit for the tests to run.
47+
timeout-minutes: 4
48+
needs: build_wolfssl
49+
steps:
50+
- name: Install dependencies
51+
run: |
52+
# Don't prompt for anything
53+
export DEBIAN_FRONTEND=noninteractive
54+
sudo apt-get update
55+
sudo apt-get install -y libcurl4-openssl-dev libjansson-dev libp11-dev librtlsdr-dev libcap-dev
56+
57+
- name: Download lib
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: wolf-install-rng-tools
61+
path: build-dir
62+
63+
- name: Checkout OSP
64+
uses: actions/checkout@v4
65+
with:
66+
repository: wolfssl/osp
67+
path: osp
68+
69+
- name: Checkout jitterentropy-library
70+
uses: actions/checkout@v4
71+
with:
72+
repository: smuellerDD/jitterentropy-library
73+
path: jitterentropy-library
74+
ref: v3.5.0
75+
76+
- name: Build jitterentropy-library
77+
working-directory: jitterentropy-library
78+
run: make -j
79+
80+
- name: Build rng-tools
81+
uses: wolfSSL/actions-build-autotools-project@v1
82+
with:
83+
repository: nhorman/rng-tools
84+
ref: v${{ matrix.ref }}
85+
path: rng-tools
86+
patch-file: $GITHUB_WORKSPACE/osp/rng-tools/${{ matrix.ref }}.patch
87+
configure: --without-pkcs11 --enable-jitterentropy=$GITHUB_WORKSPACE/jitterentropy-library --with-wolfssl=$GITHUB_WORKSPACE/build-dir
88+
check: false
89+
90+
- name: Testing rng-tools
91+
id: testing
92+
working-directory: rng-tools
93+
run: |
94+
# Retry up to five times
95+
for i in {1..5}; do
96+
TEST_RES=0
97+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib make check || TEST_RES=$?
98+
if [ "$TEST_RES" -eq "0" ]; then
99+
break
100+
fi
101+
done
102+
if [ "$TEST_RES" -ne "0" ]; then
103+
exit $TEST_RES
104+
fi
105+
106+
- name: Print logs
107+
if: ${{ failure() && steps.testing.outcome == 'failure' }}
108+
working-directory: rng-tools/tests
109+
run: cat test-suite.log

0 commit comments

Comments
 (0)